/kb

personal knowledgebase

#1064 – You have an error in your SQL syntax

without comments

When exporting and importing from and to different MySQL databases with diferent version numbers this error message might show up:

#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 ‘ENGINE=MyISAM DEFAULT CHARSET=utf8′

I got the message when exporting from a MySQL 5.x database and importing to a MySQL 4.x database. The solution came to me from the following blog post comment and is very easy. Just add the --compatible option:

mysqldump -u username -ppassword –compatible=mysql40 database_name > FILENAME.sql

Theoretically related posts

Written by hgrimelid

March 4th, 2009 at 11:28 am

Posted in Server

Tagged with ,

Leave a Reply