Home >Database >Mysql Tutorial >How to modify utf8 in mysql
Mysql method to modify utf8: first check the mysql character set through "show variables like 'character_set_%';"; then find the my.ini file in the mysql installation directory and modify it; finally restart mysql.
Recommendation: "mysql tutorial"
mysql 5.7 version modified encoding to utf-8
I just started learning mysql. I downloaded the latest version 5..7.14 from the official website. When I used cmd to input Chinese, I got an error, so I started to modify the default encoding of mysql (under windows)
First pass show variables like 'character_set_%'; View the mysql character set information
The default encoding is latin1
Then close the database
Find the my.ini file in the mysql installation directory
Add # to it
##
[client] default-character-set=utf8Add
character-set-server=utf8under [mysqld] Restart mysqlThe mysql database can be The default encoding is changed to utf-8 Many resources on the Internet are added under [mysqld]
default-character-set=utf8If this is changed, the 5.7 version of mysql cannot be opened
So change it to
character-set-server=utf8
The above is the detailed content of How to modify utf8 in mysql. For more information, please follow other related articles on the PHP Chinese website!