How linux modifies the encoding of mysql
This article introduces the relevant knowledge of "how linux modifies the code of mysql". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Linux modify mysql encoding methods: 1, view the mysql character set; 2, through "default-character-set=utf8" to modify the mysql server encoding; 3, restart the mysql service.
The operating environment of this paper: linux5.9.8 system, mysql5.5, Dell G3.
System: Aliyun
1. View the mysql character set
Input: show variables like 'character_set_%'
Second, modify the code of a certain database
Input: alter database dbname default character set utf8
3. Modify the coding of mysql server
Input: vi / etc/my.cnf
Add the following code to the yellow area:
Default-character-set=utf8 [client] default-character-set=utf8 IV. Restart the mysql service
Input: service mysqld restart
5. Check again
Input: show variables like 'character_set_%'
This is the end of the content of "how linux modifies the code of mysql". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!