MySQL Forums
Forum List  »  Newbie

Re: Error #1064 SQL syntax at line 1 - strange characters
Posted by: Rick James
Date: September 07, 2011 09:43AM

Starting over...

* The dump file looks like it was generated from mysqldump.
* mysqldump does not generate the '' (BOM)
* Therefore, someone(?) edited the dump file with an editor that prepended the BOM on it.
* mysql (for loading the dump) does not understand BOM.

So, you have an unusable file. Now, the question is how to fix the problem.

Plan A:
Recreate the dump, and hope not to get the BOM.

Assuming that Plan A is not practical...

Plan B:
Find an editor (Notepad? Notepad++? Wordpad? Textedit? Komodo? ...) that can _read_ the BOM for what it is (just an indicator), and _write_ without the BOM. That may involve some change while you have the file open, perhaps something like
File > Encoding > Ascii
(I don't know the specifics; you will have to look around. And the target will probable one of: Ascii, Text, .txt)
After saving the file in the new format, it should be acceptable to "mysql" for loading.

How to "find" an editor? Well, try them one by one. There are dozens available, either already on your machine, or freely downloadable.

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.