Announcement

Collapse
No announcement yet.

myphp error when uploading old database to new one

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • myphp error when uploading old database to new one

    Hi Guys

    Prior to transfering my hosting, I saved a copy of my database in sql.

    My new host is running php MySQL - 4.0.18-Max.

    When I try to upload the sql I get a number of error messages - see below ...

    Perhaps my previous database was running on newer version of MySQL (4.1?).

    Is there any way to make it backwards compatabile?

    Help! Thanks, hurmeez

    Error
    SQL query:

    CREATE TABLE `vb_access` (

    `userid` int( 10 ) unsigned NOT NULL default '0',
    `forumid` smallint( 5 ) unsigned NOT NULL default '0',
    `accessmask` smallint( 5 ) unsigned NOT NULL default '0',
    PRIMARY KEY ( `userid` , `forumid` )
    ) ENGINE = MYISAM DEFAULT CHARSET = latin1;

    MySQL said:

    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1' at line 6
    and

    CREATE TABLE `vb_attachment` (

    `attachmentid` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
    `userid` int( 10 ) unsigned NOT NULL default '0',
    `dateline` int( 10 ) unsigned NOT NULL default '0',
    `thumbnail_dateline` int( 10 ) unsigned NOT NULL default '0',
    `filename` varchar( 100 ) NOT NULL default '',
    `filedata` mediumblob,
    `visible` smallint( 5 ) unsigned NOT NULL default '0',
    `counter` int( 10 ) unsigned NOT NULL default '0',
    `filesize` int( 10 ) unsigned NOT NULL default '0',
    `postid` int( 10 ) unsigned NOT NULL default '0',
    `filehash` varchar( 32 ) NOT NULL default '',
    `posthash` varchar( 32 ) NOT NULL default '',
    `thumbnail` mediumblob,
    `thumbnail_filesize` int( 10 ) unsigned NOT NULL default '0',
    `extension` varchar( 20 ) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL default '',
    `importattachmentid` bigint( 20 ) NOT NULL default '0',
    PRIMARY KEY ( `attachmentid` ) ,
    KEY `filesize` ( `filesize` ) ,
    KEY `filehash` ( `filehash` ) ,
    KEY `userid` ( `userid` ) ,
    KEY `posthash` ( `posthash` , `userid` ) ,
    KEY `postid` ( `postid` ) ,
    KEY `visible` ( `visible` )
    ) ENGINE = MYISAM

    MySQL said:

    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'collate latin1_bin NOT NULL default '',
    `importattachmentid`
    I'm not really sure what all of this means other than I can't seem to restore my old database on my new server (and I don't have another copy of it!).

    Grateful for any tips from the gurus out there.

    Many thanks, hurmeez

    [Edit: Post was previously on the wrong board - moved here]

  • #2
    The MySQL 4.1.x version of mysqldump has a switch you can use to make this backup compatible with older versions:

    --compatible=name

    In your case, make a new backup and use this switch:

    --compatible=mysql40

    Then try to restore this backup to the new system.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      Thanks for the tip ... unfortunately I no longer have access to the webhost with 4.1.x, so am unable to 'flick the switch' to make it backwards compatable. Is there anything else I can try?

      Comment


      • #4
        No sorry, I don't know how to fix this. I'll ask the other support staff if they have any ideas.
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment


        • #5
          Thanks Steve. I could FTP it someone who has access perhaps and they could save it down perhaps? Sorry, not really an expert on this, but grateful for you help. Thanks again, twobob

          Comment


          • #6
            Replace all:

            ) ENGINE = MYISAM DEFAULT CHARSET = latin1;

            with:

            ) ENGINE = MYISAM ;

            Comment


            • #7
              And replace:

              `extension` varchar( 20 ) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL default '',

              with:

              `extension` varchar( 20 ) NOT NULL default '',

              Comment


              • #8
                Thanks for your help - think I found the string that was causing issues. Cheers, twobob

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X