I. gb2312, gbk, utf8, and other character sets supporting multi-byte encoding can store Chinese characters. The number of Chinese Characters in gb2312 is much smaller than that in gb2312, while that in gb2312 and gbk can be encoded in utf8.
2. Run the show variables like 'character \ _ set \ _ % 'command to view the 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)
There are two main settings for displaying Chinese garbled characters: character_set_connection and character_set_results,
If your two settings do not support Chinese encoding, garbled characters will appear. If: set character_set_results = gbk;, the Chinese encoding will be set.
3. set names charset_name; all character sets of the client can be set at one time.