Mysql method to set the client to gbk: first open the my.ini file; then modify the encoding statement to "default-character-set=gbk"; finally enter "set names gbk;" in the MySQL command line That’s it.
Recommended: "mysql video tutorial"
Set the default encoding of the mysql database to gbk, solve the problem Chinese garbled characters
To solve Chinese garbled characters in Mysql, it is best to change the default encoding of the database. Generally, it is handled like this:
In the my.ini file in the mysql installation directory:
Modify below
Line 57 is changed to: default-character-set=gbk
Modify below
Line 81 is changed to: default-character- set=gbk
Enter on the MySQL command line: set names gbk;
Then enter on the MySQL command line: status; After the command, if the following picture appears: Server Db Client Conn all four are GBK, there is no problem in supporting Chinese. I have personally tested it and it is absolutely ok!
The above is the detailed content of How to set mysql client to gbk. For more information, please follow other related articles on the PHP Chinese website!