Home >Database >Mysql Tutorial >How to set mysql client to gbk

How to set mysql client to gbk

藏色散人
藏色散人Original
2020-10-28 09:05:333290browse

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.

How to set mysql client to gbk

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn