1. Log in to MySQL and use SHOW VARIABLES LIKE 'character%'; to view the character set, as shown below: +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ The default character set for character_set_database and character_set_server is still latin1. 2. The simplest and most perfect modification method is to modify the character set key value in the my.cnf file of MySQL (pay attention to the configuration field details): 1. Add default-character-set=utf8 to the [client] field, as follows: [client] port = 3306 socket = /var/lib/mysql/mysql.sock default-character-set=utf8 2. Add character-set-server=utf8 to the [mysqld] field as follows: [mysqld] port = 3306 socket = /var/lib/mysql/mysql.sock character-set-server=utf8 3. Add default-character-set=utf8 to the [mysql] field, as follows: [mysql] no-auto-rehash default-character-set=utf8 After the modification is completed, restart the MySQL service with service mysql restart to make it take effect. Note: The [mysqld] field is different from the [mysql] field. No one has reported this online. Use SHOW VARIABLES LIKE 'character%'; to check and find that the database encoding has been changed to utf8. +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ The above method of changing the character set encoding to UTF8 in MySQL 5.5/5.6 under Linux is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Rsync+crontab regular synchronization backup under centos7
>>: Installation and use tutorial of Elasticsearch tool cerebro
The following is my judgment based on the data st...
Hello everyone, I am Qiufeng. Recently, WeChat ha...
W3C recently released two standards, namely "...
Table of contents 1. Server 2. Client 3. Testing ...
Use js to control the light switch for your refer...
This project shares the specific code of Vue+Rout...
My mysql version is MYSQL V5.7.9, please use the ...
This article installs Google Input Method. In fac...
Two implementations of Vue drop-down list The fir...
Preface This is an old demand, but there are stil...
Table of contents 1. Understanding the Equality R...
1. Explanation of provide and inject Provide and ...
Preface This article introduces the use of vue-ro...
How to solve the problem of 1045 when the local d...
If there are files that are being used by a proce...