To solve the problem of Chinese garbled characters displayed in the MySQL client output window,

Source: Internet
Author: User
Tags mysql import

To solve the problem of Chinese garbled characters displayed in the MySQL client output window,

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 online: Garbled characters are displayed because the character encoding used in the output window of the MySQL client is incorrect, 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:

The above is a solution to the problem of Chinese garbled characters displayed in the MySQL client output window. I hope it will be helpful for your learning.

Articles you may be interested in:
  • PHP + MySQL5.0 Chinese garbled Solution
  • MySQL Chinese garbled Problem Solution
  • Summary MySQL Chinese garbled characters, phpmyadmin garbled characters, causes of php garbled characters and Solutions
  • Mysql Chinese garbled solution highlights
  • How to export Chinese garbled characters in mysql and import Chinese garbled characters in phpmyadmin
  • MySQL Character Set GBK, GB2312, and UTF8 solve MYSQL Chinese garbled Problem
  • Summary of Solutions to Chinese garbled characters in mysql import and export data
  • JSP + MySQL Chinese garbled problem post submit garbled Solution
  • How to solve Chinese garbled characters in the csv file imported and exported by Mysql

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.