I'm trying to run a SQL file created by mysqldump and suprisingly I get a SQL syntax error while running the backup file on the DB. How can it be possible considering that the file was created with mysqldump? BTW the SQL error is not very indicative.
I've seen things like those happening due to reserve words (keywords)... To allow them you need to use option
--allow-keywords in your mysqldump command.
mysqldump --allow-keywords ... with your complete command options.
If this doesn't fix, share the error.
You might like to consider differences in character-set and as mentioned in this question.
As you suggested that the error is not because of the reserve words, I'd ask you to check if that's the encoding issues as mentioned here.
To use the same backup file, considering the issue is with encoding, you can change it using following steps:
- Find the encoding of a file:
file -bi FILENAME
- If the file is not in utf8 and you want to convert it you do it as follows:
iconv -f <source-encoding> -t utf8 FILENAME
You may try using the dump now.
When you say "ERROR 1064: (42000)" or "error in your SQL syntax" it's synonymous, it still doesn't convey what's causing the error. Glad to know the security precautions you're following not to post anything other than mysql error name and numbers. Anyhow, please try above and share.