MySQL garbled problem:
What happens: When you use the command line to view database data, the Chinese language is displayed as garbled.
Error when inserting Chinese data with command line.
Solution Ideas:
1, enter at the command line: [Show variables like ' character_set_% ';], if the list in the query is encoded in UTF8 (except for [Character_set_filesystem]), It is the problem of encoding format that indicates the problem of Chinese garbled characters. 1 is shown
Figure 1
2, it is necessary to change (client, connection and result set) encoding mode to gb2312 (or GBK), can correctly display Chinese and write Chinese data. You only need to enter it at the MySQL command line: [Set names GBK;] Can. 2, shown in Figure 3.
Figure 2
3, so you can display the correct Chinese. As shown in 3.
Figure 3
4, after the operation is completed, it is necessary to change the encoding method back, in the MySQL command line input: [set names UTF8;] , then the encoding method is changed back to UTF8.