Modify the default encoding of mysql5.6 under CentOS7

Refer to the original tutorial: [Modify the mysql5.6 encoding method under Centos7 to solve the question mark in the website Chinese] (http://www.cnblogs.com/uncle-box/p/5791057.html)

Solution:

Modify the MySQL database character encoding to UTF-8. UTF-8 contains the characters needed by all countries in the world and is an international encoding.

Specific operation:

1、 Enter MySQL console###

mysql  -u root -p

enter password

View current mysql running status

mysql>status

Among them, server and db were originally not utf-8; the default encoding is latin1.

2. Modify the mysql configuration file###

Default location: /etc/my.cnf

vim /etc/my.cnf

The picture is after I added the settings.

character-set-server=utf8

collation-server=utf8_general_ci

: wq! #Save and exit

systemctl restart mysql.service #Restart MySQL

mysql>status

At this time, all encodings should be UTF-8

Parameter Description:

haracter_set_client: The character set of the data requested by the client.

character_set_connection: The character set that receives data from the client and then transmits it.

character_set_database: The character set of the default database, no matter how the default database is changed, it is this character set; if there is no default database, the character set specified by character_set_server does not need to be set.

character_set_filesystem: Convert the file name on the operating system to this character set, that is, convert character_set_client to character_set_filesystem, and the default is binary.

character_set_results: The character set of the result set.

character_set_server: The default character set of the database server.

character_set_system: This value is always utf8 and does not need to be set. The character set for storing system metadata.

Recommended Posts

Modify the default encoding of mysql5.6 under CentOS7
Installation and use of Mysql under CentOS
The fourth installment of Zabbix under CentOs7
Install mysql5.7 under CentOS7
The actual combat of rpm packaging under CentOS6
Install mysql under Centos 7
Install mysql5.1 under CentOS6.5
Environment configuration of JDK, mysql and tomcat under Centos7
Install MySQL under Linux (CentOS 7)
The problem of MySQL import file failure in CentOS environment
Installation under centos6.9 of jenkins learning
Centos7 modify Docker default storage location
CentOS7 modify the network card name
Performance comparison of MySQL centos 6 vs 7
Install the latest OpenCV4.3 under Centos8
The latest Centos7 installation Mysql8 guide
Modify the software default source to Tencent source
MySQL 8.0 installation, deployment and configuration under CentOS 6/7
Installation and configuration of redis under centos7
Install mysql8.0.13 version under Linux CentOS7 system
Centos 8.1.1911 solves the problem of yum reinstallation
How to modify the hostname on CentOS 8
Construction of Zabbix monitoring platform under CentOS7
[Centos8] The bumpy process of installing docker
Summarize the knowledge points of Centos7 system reinforcement
Install MySQL 5.7 under CentOS 7 for middle class children!
Centos7.5 expands the space size under the root directory
Install the old version of seurat under Ubuntu
Install MySQL 8.x from source code under CentOS7
How to quickly modify root password under CentOS8
Installation and configuration of rsync server under CentOS 6.5
How to modify the CentOS server time to Beijing time
MySQL 8.0 installation and deployment under CentOS, super detailed!
Non-Root installation of Microsoft R Open under Centos
Centos7 modify the system language to simplified Chinese
Distributed deployment of Apollo configuration center under CentOS8
From installation to entry of FastDFS under Centos7
[Video] Teach you how to install the latest Linux version of QQ under Centos 8
CentOS7.2 install Mysql5.7.13
CentOS7 install MySQL
CentOS install mysql
CentOS7 install mysql
CentOS 7 install MySQL 5.6
CentOS7 install mysql8
CentOS7 install MySQL8
Modify CentOS hostname
Centos MySQL8 configuration
centos 7.5 install mysql5.7.17
Centos7 adjusts the size of the root directory mount partition
Installation and cracking of confluence6.3 operation records under Centos
Installation and cracking of Jira7 operation records under Centos
Online expansion of file system by LVM under Centos7