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