Gb2312,gbk,utf8, such as the support of multibyte-encoded character sets can store Chinese characters, gb2312 in the number of Chinese characters is far less than GBK, and GB2312,GBK can be encoded in the UTF8.
Two. Show variables like ' character\_set\_% ' by command; View current character Set settings:
mysql> show variables like 'character\_set\_%';
+--------------------------+--------+
| Variable_name | Value |
+--------------------------+--------+
| character_set_client | gb2312 |
| character_set_connection | gb2312 |
| character_set_database | gb2312 |
| character_set_filesystem | binary |
| character_set_results | gb2312 |
| character_set_server | latin1 |
| character_set_system | utf8 |
+--------------------------+--------+
7 rows in set (0.02 sec)
(The character set here is gb2312)
Display Chinese garbled mainly has two settings: Character_set_connection and Character_set_results,
If your two settings do not support Chinese encoding, there will be garbled, as long as: Set Character_set_results =GBK, set the Chinese code.
Three. Set names Charset_name; You can set all character sets for the client at once.