Solution to the problem of displaying Chinese garbled in Mysql Client Output window _mysql

Source: Internet
Author: User
Tags character set mysql client

Recently found in the MySQL DOS Client Output Window query table data, the table's Chinese data are displayed garbled, as shown in the following figure:

Surfing the Internet for a reason: the reason that will display garbled, because the MySQL client Output window display in Chinese character encoding is not caused by, you can use the following command to view the Output window using the character encoding: showvariables like ' char% ';
After the command completes, the results appear as follows:

As you can see, it is now used UTF8 character encoding to display Chinese data, but because the operating system is the Chinese operating system, the default character set is GB2312, so you need to change the character encoding used in the Output window to gb2312 to be able to display the normal Chinese. Use the following command to set the character encoding used by the Output window:set character_set_results=gb2312;
After the command completes, you can change the character encoding used by the Output window to gb2312, as shown in the following illustration:

At this point we execute the query again, the Chinese data in the table can be displayed normally, as shown in the following figure:

The above is for you to share the solution to the MySQL Client Output window display Chinese garbled problem, I hope to help you learn.

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.