Last Updated: February 25, 2016
·
2.812K
· fideloper

Mysqldump for UTF8

Use the --default-character-set=utf8 flag with mysqldump to enforce utf8 character set.

It may also helps to use -r mydatabase.sql instead of > mydatabase.sql with special characters.

So, instead of:

$ mysqldump -u whatever -p mydatabase > mydatabase.sql

Use

$ mysqldump --default-character-set=utf8 -r mydatabase.sql -u whatever -p mydatabase

This helps with localized content, especially with non-latin alphabets