Home > Database > Mysql Tutorial > body text

How to set mysql client to gbk

藏色散人
Release: 2020-10-30 16:55:00
Original
3257 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template