To view the database character set:
Show database Create dbname \g;
To view the database table character set:
Show table Create Tbname \g;
To view the existing database character set settings:
Show variables like ' character_set% ';
To temporarily modify a character set:
Set names Latin1|utf8;
-------------------------------------------
Non-production environment:
ALTER DATABASE character xxx;
ALTER TABLE tbname character xxx;
Premise: The character set data that has already been recorded cannot be modified,
Production environment Change Character set:
have been running for some time the library modified
Modify the process:
1. Export Table structure
mysqldump-d parameters
2, modify the table structure SQL content, replace the character set keyword such as Latin1 changed to UTF8
3, export the table data, this time can not write data
--no-create-info Export only creation statements
4. Modify data SQL file Latin1 to UTF8
5. Create the specified library
6. Create the specified table
7. Import the specified data
Enterprise Case--production link change MySQL character set