Home  >  Article  >  Database  >  mysql 不能插入中文问题

mysql 不能插入中文问题

WBOY
WBOYOriginal
2016-06-07 18:05:341088browse

当向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服务,重新创建一个数据库。
Statement:
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