Home > Database > Mysql Tutorial > mysql 不能插入中文问题_MySQL

mysql 不能插入中文问题_MySQL

WBOY
Release: 2016-06-01 13:22:24
Original
869 people have browsed it

bitsCN.com 问题现象:

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

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