2

I'm on a japanese system using xampp. This is the line I use to dump my database.

c:\xampp\mysql\bin>mysqldump.exe -uroot wp_newsja > dump.sql

Then I create a database on another server.

c:\xampp\mysql\bin>mysqladmin -uroot create db

But when I try to execute the sql...

c:\xampp\mysql\bin>mysql -uroot db < dump.sql

... I get the following error.

ERROR at line 145: Unknown command '¥''.

On a japanese computer windows path slashes / are represented with "¥". Which leads me to believe this is an utf8 issue. Maybe there is a way I can mysqldump with some utf8 flag? Thanks for any assistance! The exported sql is here: https://dl.dropbox.com/u/38886912/dump.sql - Error at line 145:

edit: Problem solved:

mysql --default-character-set=utf8 db < dump.sql

Sorry if I wasted anyone's time.

2 Answers 2

5
mysql --default-character-set=utf8 db < dump.sql
Sign up to request clarification or add additional context in comments.

Comments

0

You can add this argument --default-character-set=utf8 in the command:

mysql -u USERNAME -p my_database --default-character-set=utf8 < "C:/My Document Names Have Spaces/my_dump.sql"

I've finally found this solution and it works fine with my new installed WampServer 2.5. I've also tried to add the default character setting in my.ini, but it's useless. Until I've tried the above argument added in my DOS batch file.

My batch file execute the command, like this way: 7zip x -so %1.%2.7z|%mysql% -uxxxx -pyyyyy %2 --default-character-set=utf8

For example, the 7zip filename is 20141231.google.7z, which contains "google.sql", and the database name is google

My backup process on Linux system was a 7zip compressed. In Winodws, I used an automatic batch file to restore the same contents, so that I can share the same database in my biz trip and work offline from the server.

Hope this method is helpful to you.

1 Comment

What value does this answer add to the existing and accepted answer?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.