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
Recently, when I was drawing an interface, I enco...
This article example shares the specific code of ...
When using the docker-maven-plugin plug-in, Maven...
Drag the mouse to take a screenshot of the page (...
1. Check the MySQL database encoding mysql -u use...
Table of contents 1. Mathematical functions 2. St...
Table of contents Rendering Install Code Implemen...
Resume Code: XML/HTML CodeCopy content to clipboa...
1. Install MySQL database on mac 1. Download MySQ...
Table of contents Problem scenario: Solution: 1. ...
Hyperlinks enable people to jump instantly from pa...
This article mainly introduces the process analys...
SRIOV introduction, VF pass-through configuration...
Table of contents 1. Introduction 2. Usage 3. Dev...
Table of contents 1. Props Parent >>> Ch...