While importing mysqldump file ERROR 1064 (42000) near ' ■/ ' at line 1
Finally I got a solution
We need two options
--default-character-set=utf8
: This insures UTF8 is used for eachfield--result-file=file.sql
: This option prevents the dump datafrom passing through the Operating System which likely does notuse UTF8. Instead it passes the dump data directly to the filespecified.
Using these new options your dump command would look something like this:
mysqldump -u root -p --default-character-set=utf8 --result-file=database1.backup.sql database1
While Importing you can optionally use:
mysql --user=root --password=root --default_character_set utf8 < database1.backup.sql
Source:http://nathan.rambeck.org/blog/1-preventing-encoding-issues-mysqldump
It seems that the input file (mysqldumpfile.sql) was created in UTF-8
encoding so these first 3 bytes "at line 1" invisible to you in the .SQL file is the byte order mark (BOM) sequence
So try to change default character set to UTF-8
mysql --user=root --password=root --default_character_set utf8 < mysqldumpfile.sql