Home >Database >Mysql Tutorial >How to set the character set to UTF8 in mysql
The method for setting the character set of mysql to UTF8 is: 1. Edit the my.ini file and modify the configuration [default-character-set=utf8]; 2. Restart the mysql service; 3. Log in to the mysql service again and view Character set settings.
MySQL method to set all character sets to utf8:
(recommended learning: mysql tutorial)
1. Open the my.ini file in the MySQL installation directory and edit the following content:
[client]节点 default-character-set=utf8 (增加) [mysql]节点 default-character-set=utf8 (修改) [mysqld]节点 default-character-set=utf8 (修改) character_set_server=utf8 (增加)
2. Restart the mysql service
net stop mysql net start mysql
3. Log in to mysql again and execute the following command to view Current database character set configuration
show variables like '%character%';
The above is the detailed content of How to set the character set to UTF8 in mysql. For more information, please follow other related articles on the PHP Chinese website!