Blogger Information
Blog 41
fans 0
comment 1
visits 40651
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Windows / Linux下MySQL的修改字符集编码为UTF8(解决中文乱码问题)
yeyiluLAMP
Original
1278 people have browsed it


Linux下修改mysql的目录下的 /etc/my.cnf(Windows下修改 my.ini )文件中的字符集键值(注意配置的字段细节):

1、在[client]字段里加入default-character-set=utf8,如下:

[client]
default-character-set=utf8

 

2、在[mysqld]字段里加入character-set-server=utf8,如下:

[mysqld]
character-set-server=utf8

 

3、在[mysql]字段里加入default-character-set=utf8,如下:

[mysql]
default-character-set=utf8

修改完成后,重启MySQL

service mysqld restart

CentOS7.x 版本亦可执行:

systemctl restart mysqld.service


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post