All the answers I see on this question can have problems with the character sets in some databases due to the problem of redirecting the exit of mysqldump to a file within the shell operator >.
To solve this problem you should do the backup with this command line. The -r flag does the same as the shell operator > but without the character-set problems.
mysqldump -u root -p --opt --all-databases -r alldb.sql
or
mysqldump.exe --all-databases > alldb.sql
To do a good BD restore without any problem with character sets use these commands (you can change the default-character-set as you need).
cmd
mysql -uroot -p --default-character-set=utf8
mysql> SET names 'utf8';
mysql> SOURCE alldb.sql;
No comments:
Post a Comment