1. Add Default-character-set=utf8 to the [client] field as follows:
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=utf8
2. Add Character-set-server=utf8 to the [mysqld] field as follows:
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
character-set-server=utf8
3. Add Default-character-set=utf8 to the [MySQL] field as follows:
[mysql]
no-auto-rehash
default-character-set=utf8
net start MySQL;
Mysql-hlocalhost-uroot-p Enter the MySQL database, where-H is the server name, localhost means local;-U is the database user name, root is the MySQL default username;-P is the password, if the password is set, Can be directly after-p link input, such as:-p123456, the user does not set the password, display enter password, directly enter. Note that if your MySQL is not installed in the C drive, you will need to use the DOS command to go to the bin directory in the MySQL installation directory. Take My computer as an example, the method is as follows: Enter D: Enter the D-drive, enter the bin directory of the MySQL in the input CD D:\Tools\MySQL5.5.25\bin to enter the Mysql-hlocalhost-uroot-p
SHOW VARIABLES like ' character% ';
MYSQL Modify Character Set