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