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
Written by Chris Fidao
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#