Troubleshooting the problem of garbled characters displayed in the DOS command line window mysql

The data written to mysql through SQLyog (SQLyog is utf8, after connecting to the database, execute mysql_query("set names utf8")), after the data is written successfully, read and write information in the SQLyog page, normal.

But in the command line window, select * from `grade`; shows that the data just inserted is garbled.

 

After multiple inquiries, I learned that the command line window does not support utf8.

After connecting to the database on the command line, execute set names GBK;

Then query the data, the Chinese records can be displayed normally.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326677720&siteId=291194637