How to change the encoding character set of the mysql database: 1. Open the my.ini configuration file; 2. Find the mysqld label and add the configuration [character-set-server=utf8] under the label; 3. Restart mysql service.
Specific method:
(Recommended tutorial: mysql tutorial)
1. Enter mysql In the installation directory, find the my-default.ini or my.ini configuration file. You can modify my-default.ini to my.ini.
2. My my.ini only has one [mysqld] tag, and the others are in comment state. We do two things in my.ini
(1) In the [mysqld] tag Add: character-set-server=utf8
(2) Add a [client] tag, and add: default-character-set=utf8
3, Restart the mysql service;
4. Enter the dos interface, log in to the database, and enter the command: show variables like "%char%"; if the result shown in the figure below appears on the dos interface, it means that you have successfully modified the mysql encoding.
Related recommendations: php training
The above is the detailed content of How to change the encoding character set of mysql database. For more information, please follow other related articles on the PHP Chinese website!