How to modify mysql encoding in Linux: 1. Check the mysql character set; 2. Modify the encoding of the mysql server through "default-character-set=utf8"; 3. Restart the mysql service.
The operating environment of this article: linux5.9.8 system, mysql5.5, Dell G3.
System: Alibaba Cloud
Input: show variables like 'character_set_%';
Input: alter database dbname default character set utf8;
Input :vi /etc/my.cnf
Add the following code in the yellow area:
default-character-set=utf8 [client] default-character-set=utf8
Enter: service mysqld restart
Input: show variables like 'character_set_%';
## Recommended study: "mysql video tutorial》
The above is the detailed content of How to modify the encoding of mysql in linux. For more information, please follow other related articles on the PHP Chinese website!