Home > Database > Mysql Tutorial > MySQL中文乱码问题_MySQL

MySQL中文乱码问题_MySQL

WBOY
Release: 2016-06-01 13:17:17
Original
1022 people have browsed it

项目中用到MySQL数据库时中文出现乱码问题(中文字符都变成了?)解决:

1、统一项目与数据库的编码,项目中用的是UTF-8因此我的把数据库的编码统一成UTF-8

修改方式:修改 MySQL根目录中的 my.ini 文件替换default-character-set=latin为default-character-set=utf8(注意有两处需要替换)

/

2、修改完保存退出,然后重启MySQL服务(重启目的很明显就是重新加载配置文件),重新创建数据库即可。

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