MySQL client output window display Chinese garbled Problem Solution

Source: Internet
Author: User

MySQL client output window display Chinese garbled Problem Solution

Recently, it was found that when querying table data in the MySQL dos client output window, Chinese data in the table is displayed as garbled characters, as shown in:

Check the cause on the Internet: Garbled characters are displayed because the character encoding used in the output window of the MySQL client is incorrect. You can run the following command to view the character encoding used in the output window:

Show variables like 'Char % ';

After the command is executed, the result is shown as follows:

We can see that the utf8 character encoding is used to display Chinese data. However, because the operating system is a Chinese operating system, the default character set is GB2312, therefore, you must change the character encoding used in the output window to gb2312 to display Chinese characters normally. Use the following command to set the character encoding used in the output window:

Set character_set_results = gb2312;

After the command is executed, you can change the character encoding used in the output window to gb2312, as shown in:

Now we can run the query again to display the Chinese data in the table, as shown in:

This article permanently updates the link address:

  • 1
  • 2
  • Next Page

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.