The MySQL command line garbled solves the problem. Using the MySQL command line can implement many features we need, but when using the MySQL command line, one problem is that garbled characters or errors occur when you insert Chinese data or query Chinese data in the MySQL command line. On the MySQL command line, enter show variables like 'character _ set _ % '; www.2cto.com to view the current encoding. On the MySQL command line, enter set names utf8; it is equivalent to set character_set_client = utf8; set bandwidth = utf8; set character_set_connection = utf8; the three commands www.2cto.com run the set names gbk command before the command line inserts data; or set names gb2312; run the set names gbk command before inserting the query data; or set names gb2312; after the query is complete, set names utf8; then the Chinese language can be inserted and queried normally and the database code is utf8.