Solution to the problem that Chinese characters in mysql cannot be displayed: 1. Find the mysql configuration file [my.ini], find [default-character-set], and change the parameters to gbk; 2. Check the structure of the table , change the character set of username in the user table.
##More related free learning recommendations: mysql tutorial(Video)
Solution to the problem that Chinese cannot be displayed in mysql:
1. Because the windows operating system uses gb2312 by default This character, when mysql is installed, both the client and the server use latin1 by default, so this leads to a problem of character set and character verification mismatch. At this time, you only need to find the mysql configuration file my.iniFind
default-character-set and just change its parameters to gbk. There are two such parameters, one for the client and one for the server.
default-character- set=latin1 default-collation=latin1_swedish_ci Change to
default-character-set=gbk defaultcollation=gbk_chinese_ci and restart the service. The encoding method of tables created later will change. Can display Chinese.
mysql> show create table users;
mysql> truncate table users;
mysql> alter table users modify username char(20) character set gbk;
mysql> insert into users values(88,'中文');
The above is the detailed content of What should I do if the Chinese in mysql cannot be displayed?. For more information, please follow other related articles on the PHP Chinese website!