3

How to change encoding of the mysql dump files? When I run mysqldump command it creates file encoded in ANSI. How to change it to utf-8? I have also tried to do this:

mysqldump --user=user1--password=pas1 --default-character-set=utf8 mydb1 mytbl1 > e:\1.sql
9
  • "Encoded in ANSI" - I doubt that. Where do you have this information from? Note that text editors are not always successful in detecting encodings. My bet is that the encoding already is UTF-8. Commented Oct 5, 2011 at 14:45
  • I opened dump file in the notepad++. Also I see '?'-symbols instead of russian symbols. Commented Oct 5, 2011 at 14:48
  • does Notepad++ have an encoding menu? Try selecting UTF-8 there. I'm willing to bet a beer that it'll work then Commented Oct 5, 2011 at 14:49
  • Yes, it has. I tried to convert and watch it like UTF-8, but it does not help. Commented Oct 5, 2011 at 14:52
  • don't try to convert it, just switch the view to UTF-8 without any conversion. Commented Oct 5, 2011 at 14:52

1 Answer 1

13

According to this forum thread, the culprit is the > filename redirection on Windows, which seems to have trouble with UTF-8 characters.

Try using the --result-file parameter instead.

Sign up to request clarification or add additional context in comments.

2 Comments

Wow, this really saved my day!
There is no forum thread linked. Also, I'm pretty sure Windows (well, cmd.exe to be precise) performs binary redirection, so if this fix helps, it's only because mysqldump does something silly when outputting to stdout on Windows.

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.