Newer release of mysqldump uses UTF8 as its default charset if nothing is specified, while older versions (older than 4.1 typically) use Latin1 as default characterset.
If your database charset is Latin1 and dump in UTF8 collation, the data may ends up become simply rubbish, garbled, or unreadable.
In the other hand, if you database charset is already in UTF8, when you run mysqldump from a Linux shell, you may still get garbled data. If this happens to you, check your shell's locale
% locale
If your current locale is not utf8, run "locale -a" to see if you have utf8 installed. If you do, switch your shell to that locale and you are fine. If you really want to make sure data is exported in utf8 encoding, you can specify the charset as an option when you run mysqldump:% mysqldump -u db_user -p --default-character-set=utf8 db_name > db_dump.sql
When you are going to import the utf8 backup file into mySQL database,you can specify the same option:% mysql -u db_uer -p --default-character-set=utf8 db_name < db_dump.sql
Recent comments
8 weeks 4 days ago
9 weeks 3 days ago
20 weeks 3 days ago
21 weeks 6 days ago
30 weeks 4 days ago
30 weeks 5 days ago
31 weeks 5 days ago
32 weeks 4 days ago
32 weeks 4 days ago
32 weeks 5 days ago