Home > Database > Mysql Tutorial > body text

mysql 不能插入中文问题

WBOY
Release: 2016-06-07 18:05:34
Original
1087 people have browsed it

当向mysql5.5插入中文时,会出现类似错误 ERROR 1366 (HY000): Incorrect string value: '\xD6\xD0\xCE\xC4' for column

问题现象:

当向mysql5.5插入中文时,会出现类似错误

ERROR 1366 (HY000): Incorrect string value: '\xD6\xD0\xCE\xC4' for column
问题原因:

Db characterset的字符集设成了latin1

解决方案:

修改mysql 安装目录下的 my.ini 文件为


default-character-set=utf8
character-set-server=utf8

然后mysql服务,重新创建一个数据库。
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!