NAVICAT Premium SQL Import Chinese garbled solution

Source: Internet
Author: User
Tags win32

Today, when I help my friend find a bug, I'm ready to import the data from her database, so I tried to import the MySQL command below the MySQL management tool navicat. It turns out that the imported Chinese characters are all garbled, so try this:

In the settings for connection properties, advanced-"Use the MySQL character set" To remove the hook, and change the encoding to 10008-gb2312.
Then, after entering the NAVICAT console, show variables like ' char% '; commands are as follows:
+--------------------------+---------------------------------------+
| variable_name | Value |
+--------------------------+---------------------------------------+
| character_set_client | Latin1 |
| character_set_connection | Latin1 |
| Character_set_database | UTF8 |
| Character_set_filesystem | binary |
| Character_set_results | Latin1 |
| Character_set_server | UTF8 |
| Character_set_system | UTF8 |
| Character_sets_dir | d:/mysql-5.1.32-win32/share/charsets/|

At this point we need to run the set names ' GBK ' command in the console and run it again to show variables like ' char% '; command to view the results as follows:

+--------------------------+---------------------------------------+
| variable_name | Value |
+--------------------------+---------------------------------------+
| character_set_client | GBK |
| character_set_connection | GBK |
| Character_set_database | UTF8 |
| Character_set_filesystem | binary |
| Character_set_results | GBK |
| Character_set_server | UTF8 |
| Character_set_system | UTF8 |
| Character_sets_dir | d:/mysql-5.1.32-win32/share/charsets/|

The Client connection environment setting is complete. Then the Chinese data how to plug in or how to plug, no longer garbled appearance.

For bulk import of data from. Sql.txt and other text, you need to convert the corresponding file into a GBK format to save and re-import, otherwise it will be garbled after import.

Then delete the previously garbled table and create a new one.

If the output encoding format is not the above format, you can also use the following SQL statement to modify it, the MySQL command set the encoding format: set character_set_server = ' UTF8 '; Reprint Please specify source: http://blog.csdn.net/pearyangyang/article/details/46127005

NAVICAT Premium SQL Import Chinese garbled solution

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.