Before learning MySQL time, the experiment notes, today finishing the time to see, so record, memo
1. Export Table structure
Mysqldump-uroot-predhat12345-s/data/3306/mysql.sock--default-character-set=latin1-d Kitty>kittytable.sql
Description:-D only Guide table structure
2, edit kittytable.sql, change lantin1 to UTF8
Can be bulk modified with SED
3. Make sure the database is no longer updated, export all data
Mysqldump-uroot-predhat12345-s/data/3306/mysql.sock--quick--no-create-info--extended-insert-- Default-character-set=latin1 Kitty>kittydata.sql
4. Open Kittydata.sql, change set names latin1 to set names UTF8
5, delete the original library table and data (need to be cautious)
6. Build the Library
Create DATABASE kitty default CharSet UTF8;
7, create the table, execute Kittytable.sql
Mysql-uroot-predhat12345-s/data/3306/mysql.sock Kitty<kittytable.sql
8. Import data
Mysql-uroot-predhat12345-s/data/3306/mysql.sock Kitty<kittydata.sql
This article is from the "Frozen vs watermelon" blog, so be sure to keep this source http://molewan.blog.51cto.com/287340/1940839
How to change the character set of a production MySQL database library table