MySQL stores Chinese characters and displays garbled characters using MySQL command line client. However, you can use MySQL admin/sqlyog to view the configuration file my. INI, which contains the encoding method settings for the client and server.
If the default encoding on the server is set to utf8, the data is stored in utf8 mode, which is correct. However, if you want to view the data from MySQL command line client, that is, the client, if the default encoding set by the client is utf8, garbled characters will occur. Therefore, you can change the default encoding of the client to GBK without affecting the encoding used by data storage, only when we use MySQL command line client to view data, the returned data is converted to GBK Encoded chinese characters.
This eliminates the need to set names "GBK" every time.
The specific settings are as follows:
In my. ini:
Client:
[Client]
Port = 3306
[MySQL]
Default-character-set = GBK
Server:
[Mysqld]
# The default character set that will be used when a new schema or table is
# Created and no character set is defined
Default-character-set = utf8 from: http://hi.baidu.com/%CE%A4%CF%F2%D1%F4/blog/item/571aa686b1d43226c75cc31f.html