WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Mysql Restore Problem (9 posts)

  1. knotty
    Member
    Posted 8 years ago #

    I did restores successfully before, don't know what's wrong here.

    1.I downloaded the whole blog files to c:/ and ftped it to the new host.

    2. Made a sql backup and created the exact same mysql db at new host. When trying to restore sql, I get this error:

    MySQL said: Documentation
    #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 AUTO_INCREMENT=8' at line 32

    Thanks..

  2. khimichcom
    Member
    Posted 8 years ago #

    Seems that you are trying to import into 3.x MySQL dump from 4.x database

  3. Mark (podz)
    Support Maven
    Posted 8 years ago #

    It is not a mysql version problem.

    DEFAULT CHARSET=latin1

    Open the .sql file in a plaintext editor
    Replace the line above with nothing (there are at least 9 so use search/replace)
    Save
    Retry :)

    (and modify a copy - just in case)

  4. knotty
    Member
    Posted 8 years ago #

    Oh boy podz, it worked like a charm! I was beginning to sweat bullets!

    Thank you, thank you!
    knotty back to normal.

  5. Mark (podz)
    Support Maven
    Posted 8 years ago #

    Excellent :)

  6. cookiedude
    Member
    Posted 8 years ago #

    I get nearly the same error. Only in my scenario it says:

    #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 utf8_unicode_ci NOT NULL default '',category_nicen</code>

    And also, the import stops at this point (according to phpMyAdmin):
    CREATE TABLE wp_categories (
    cat_ID bigint( 20 ) NOT NULL AUTO_INCREMENT ,
    cat_name varchar( 55 ) COLLATE utf8_unicode_ci NOT NULL default '',
    category_nicename varchar( 200 ) COLLATE utf8_unicode_ci NOT NULL default '',
    category_description longtext COLLATE utf8_unicode_ci NOT NULL ,
    category_parent int( 4 ) NOT NULL default '0',
    PRIMARY KEY ( cat_ID ) ,
    KEY category_nicename ( category_nicename )
    ) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT =15;`

    Any idea what needs to be done? Thanks in advance for your help!

  7. khimichcom
    Member
    Posted 8 years ago #

    The same problem, you trying to import more recent mysql' dump, than your system handles. If you have not any unusual symbols in your database (used by utf8), then just replace with any texteditor "COLLATE utf8_unicode_ci" strings to nothing.

  8. cookiedude
    Member
    Posted 8 years ago #

    Ah thanks. Found out that setting export compatibility to "MYSQL40" also did the trick and imported the database just fine. Unfortunately I do use "unusual symbols", the special characters from the German alphabet. I've read that I need to set the character encoding to latin1 when importing in phpMyAdmin, but I don't have that option. Are there any tools that will let me convert the character encoding of the SQL dump? I tried Notepad++, but that doesn't have the options I need, I can only convert from UTF-8 to ANSI etc.

  9. jersey
    Member
    Posted 8 years ago #

    cookiedude..... the mysql40 tricked worked for me as well. thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags