MySQL Chinese garbled in Linux

Source: Internet
Author: User

Problem Description: When we load MySQL operation database on Linux system, there will be Chinese garbled problem, such as insert operation, found the data added to the database in Chinese, the following will solve the Linux MySQL Chinese garbled problem! :

Environmental centos6.5

1. Open the Linux window and start MySQL:

Mysql-uroot-proot

2. After connecting to MySQL, enter:

Show variables like '%char% ';

3. Configure the/ETC/MY.CNF as follows (if/ETC/MY.CNF does not exist, you can create a new/etc/my.cnf file):

[Client]default-character-set=UTF8 [Mysqld]datadir=/var/lib/Mysqlsocket=/var/lib/mysql/Mysql.sockuser=MySQL#disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0#Default-character-set=utf8Character-set-server=Utf8init_connect='SET NAMES UTF8'[Mysql]no-auto-Rehashdefault-character-set=UTF8 [Mysqld_safe]log-error=/var/log/Mysqld.logpid-file=/var/run/mysqld/mysqld.pid

4. Restart MySQL

Service MySQL stop;

Service MySQL status;

Service MySQL start;

5. Connect MySQL, enter:

Show variables like '%char% ';

This means that the MySQL Chinese garbled has been resolved.

MySQL Chinese garbled in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.