Configure MySQL character encoding

Configure MySQL character encoding

One, first close the mysql service
service mysql stop

Two, configure the character encoding format

Modify the configuration file
vi /usr/my.cnf


Add the following code above [mysqld]
[mysql]
default-character-set=uft8

Under [mysqld]
character-set-server=utf8
collation_server=utf8_general_ci
Insert picture description here
3. Restart the
mysql service service mysql start

Fourth, finally rebuild the table test, because the original is the original encoding format

Guess you like

Origin blog.csdn.net/qq_43288259/article/details/113972002