A perfect solution for failing to display Chinese Characters in mysql

Source: Internet
Author: User

When you use a client or other methods to connect to data and type Chinese data, garbled characters are displayed in the client. Of course, this is a problem with character set settings. I tried many methods, but still cannot display Chinese in the client. I tried to modify the data in my. ini.

In the [client]

.

# Here follows entries for some specificprograms

Default-character-set = utf8

Zheng

[Mysqld]

Join

Character-set-server = utf8

 

Then I set all the data to utf8, opened the database file with a visual tool, and found that the data in the database is indeed in Chinese, but the client interface is still garbled, however, this time it seems that Chinese characters are garbled, and some Chinese characters can still be displayed.

It seems that I have seen hope. I know that I have not set it yet. Of course, it must be because the character set of the client is incorrect. Suddenly I think that the default display mode of the client is gbk, then I

Modify data in My. ini

# Here follows entries for some specificprograms

Default-character-set = gbk

Change the display mode of the client to gbk.

Type in the client.

SETcharacter_set_database = utf8;

SETcharacter_set_server = utf8;

SETcharacter_set_client = gbk;

SETcharacter_set_connection = gbk;

 

It will be displayed normally.

 

Related Article

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.