Recently found in the MySQL DOS Client Output Window query table data, the table's Chinese data are displayed garbled, as shown in the following figure:
Surfing the Internet for a reason: the reason that will display garbled, because the MySQL client Output window display in Chinese character encoding is not caused by, you can use the following command to view the Output window using the character encoding: showvariables like ' char% ';
After the command completes, the results appear as follows:
As you can see, it is now used UTF8 character encoding to display Chinese data, but because the operating system is the Chinese operating system, the default character set is GB2312, so you need to change the character encoding used in the Output window to gb2312 to be able to display the normal Chinese. Use the following command to set the character encoding used by the Output window:set character_set_results=gb2312;
After the command completes, you can change the character encoding used by the Output window to gb2312, as shown in the following illustration:
At this point we execute the query again, the Chinese data in the table can be displayed normally, as shown in the following figure:
The above is for you to share the solution to the MySQL Client Output window display Chinese garbled problem, I hope to help you learn.