mysqldump command is the mostly preferred way to backup a database (or a collection of databases). After restoring database from the dumped file you may encounter with distorted unicode characters.
Using UTF8 option while backing up and restoring database will prevent this problem.
So use following command to back the database :
mysqldump -u <user> -p --default-character-set=utf8 <dbname> -r <dump_file>
and use following command to restore from dump file
mysql --default-character-set=utf8 -u <user> -p <dbname> -e "<dump_file>"
(yes fıle name is in quotes)
Hiç yorum yok:
Yorum Gönder