Home > MySQL > Making mysqldump compatible with older versions

Making mysqldump compatible with older versions

October 28th, 2005 Tony Leave a comment Go to comments

If you receive some errors such as the following when trying to import your mysql database dump you are most likely attempting to dump a database from a newer version of MySQL and import it into an older version:

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′

OR

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=utf-8′

Solution?
Add the following parameter to your msyqldump statement:

–compatible=mysql40

Categories: MySQL Tags:
  1. José Miguel Ruiz
    June 23rd, 2008 at 10:36 | #1

    Just a comment: you should use –compatible=mysql40. With two “-” chars.