Solution to mysql dos garbled code: 1. View all mysql encodings through "show variables like 'character%';", and then change the client encoding to gbk; 2. Open the my.ini configuration file, Modify the client encoding and then restart the service.
The operating environment of this tutorial: Windows 10 system, MySQL version 5.7, Dell G3 computer.
mysql dos What to do if the code is garbled?
MySQL DOS operation data garbled solution
MySql database displays garbled characters in Chinese on the Dos interface as shown below:
Reason: Because The problem with mysql client encoding is utf8, and the system cmd window encoding is gbk
Solution (temporary solution): Modify the mysql client encoding.
show variables like 'character%'; View all mysql encodings
Encoding settings related to the client in the picture:
client connetionresult is related to the client
database serversystem is related to the server
Change the client encoding to gbk.
setcharacter_set_results=gbk; / set names gbk;
The above operations are only effective for the current window and will become invalid if the server is closed. If you want to make permanent changes, use the following method:
There is a my.ini file in the mysql installation directory
default-character-set=gbk client encoding setting -set-server=utf8 Server-side encoding setting
Note: After modifying the configuration file, restart the service.
Recommended learning: "
MySQL Video TutorialThe above is the detailed content of What to do if mysql dos is garbled?. For more information, please follow other related articles on the PHP Chinese website!