Sqlyog Chinese garbled Solution

Source: Internet
Author: User

Sqlyog Chinese garbled Solution

 

Initial situation:

· I am using sqlyog enterprise v8.18.

· The text encoding used by eclipse is GBK by default;

While the server-installed MYSQL: mysql-essential-5.1.47-win32.msi, the specified character encoding is utf8.

 

When I use sqlyog to view the data tables and data generated by my JPA project, I find that Chinese data is garbled.

 

First judgment:

The text encoding of eclipse is inconsistent with the character encoding of MySQL database.

Modify eclipse settings, window-> preferences-> General-> workspace,

Locate text file encoding, select other, and change to UTF-8.

At this point, you need to adjust the text to the correct encoding for all the programs that use Chinese in the project. Delete the database tables and data, execute the JPA project, and regenerate the table and data.

As a result, sqlyog is used to view the data table, and garbled characters are still displayed.

 

Search online. solution:

· Enter the following code under sqlyog and execute all

Set character_set_client = utf8;
Set character_set_results =
Gb2312;
Set character_set_connection = utf8;

· Modify fonts in sqlyog menu tools> preference base> Editor

As a result, sqlyog is used to view the data table, and garbled characters are still displayed. The online method is not feasible!

 

Third judgment:

To support the complete Chinese Character Set, MySQL should be set to GBK encoding.

Find my. ini in the MySQL installation directory and change utf8 to GBK, as shown below:

Default-character-set = GBK

There are two parts to be modified.

Restart the MySQL service.

Result: The data table is displayed normally with sqlyog.

 

We hereby record it!

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.