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.

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.