Change Mysql5.7 default encoding is latin1 to utf8 database to solve the problem can not be modified

1, to modify the character set utf8
open MYsql configuration file, the following path: MySQL \ MySQL Server 5.7 \ my.ini
Press i to enter the edit mode and add the following configuration,
[Client]
default = utf8-Character-SET
[MySQL]
default- SET-UTF8 = Character
[mysqld]
Character-Server-SET = UTF8

2. Start mysql service mysql enter the terminal to see the character set
to see the current character set encoding

show variables like '%char%';

 

 

3, another point has set the character set 5.7 points make it difficult subject you will find that once you've set up, you create the database before or latin1, no matter how you set are of no use

 

 

Red has been a landmark at the database = latin1,
it is because the database 5.7 database that has been officially abandoned, if mysql took the trouble to upgrade to 8.0 you can set the character set, if not set, then 5.7 years old with the data will not change your settings, unless you create a new library of the old database and then migrated manually get rid of the character set of each database.

 

 

 

Guess you like

Origin www.cnblogs.com/zouhao/p/12110724.html