1 环境: MySQL Server 6.0  命令行工具

2 问题 :  插入中文字符数据出现如下错误:

ERROR 1366 (HY000): Incorrect string value: '\xC0\xEE\xCB\xC4' for column 'usern ame' at row 1

3 当时环境:

mysql> insert into user(id  , username , birthday, sex, address) values('' ,  '
李四' , ' -' , 'male' , 'beijing');
ERROR (HY000): Incorrect string value: '\xC0\xEE\xCB\xC4' for column 'usern
ame' at row 1
mysql> select * from user;
Empty set (0.00 sec) mysql> set names gbk;
Query OK, rows affected (0.00 sec) mysql> insert into user(id , username , birthday, sex, address) values('' , '
李四' , ' -' , 'male' , 'beijing');
Query OK, row affected (0.10 sec) mysql> select * from user;
+----+----------+------------+------+---------+
| id | username | birthday | sex | address |
+----+----------+------------+------+---------+
| | 李四 | - | male | beijing |
+----+----------+------------+------+---------+
row in set (0.00 sec)

4 总结

当出现乱码,就是编码的问题,可以尝试设置数据库的编码(set nams gbk)。

mysql 插入中文时出现ERROR 1366 (HY000): Incorrect string value: '\xC0\xEE\xCB\xC4' for column 'usern ame' at row 1的更多相关文章

  1. ERROR 1366 (HY000): Incorrect string value: '\xD6\xD0\xCE\xC4' for column XXX at row 1

    本错误为:该列的插入格式有误 修改该表中该列的字符集为utf-8 网上办法: )不能插入中文解决办法: 向表中插入中文然后有错误. mysql> insert into users values ...

  2. MySQL学习笔记04 插入中文时出现ERROR 1366 (HY000)

    1 环境: MySQL Server 6.0  命令行工具 2 问题 :  插入中文字符数据出现如下错误: ERROR 1366 (HY000): Incorrect string value: '\ ...

  3. ERROR 1366 (HY000): Incorrect string value: '\xD5\xC5\xC8\xFD' for column 'name' at row 1

    ERROR 1366 (HY000): Incorrect string value: '\xD5\xC5\xC8\xFD' for column 'name'  at row 1   数据库字符集问 ...

  4. ERROR 1366 (HY000): Incorrect string value: '\xB3\xA4\xC9\xB3' for column

    在用以下方法之前,请先执行下面命令查看. show variables like 'character%';  ——查看所有编码方式 show create table table_name;   — ...

  5. MYSQL写入数据时报错ERROR 1366 (HY000): Incorrect string value: '\xE8\x8B\xB1\xE5\xAF\xB8...' for c 插入中文不能插入

    先把原先你创建的这个表删除,然后 CREATE TABLE IF NOT EXISTS tdb_goods( goods_id SMALLINT UNSIGNED PRIMARY KEY AUTO_I ...

  6. mysql insert中文乱码无法插入ERROR 1366 (HY000): Incorrect string value

    ERROR 1366 (HY000): Incorrect string value: '\xB1\xEA\xCC\xE2\xD5\xE2...' for column 'title' at row ...

  7. Mysql插入中文时提示:ERROR 1366 (HY000): Incorrect string value: '\xE5\x8F\xB0\xE5\xBC\x8F...' fo

    Mysql插入数据时提示:ERROR 1366 (HY000): Incorrect string value: ‘\xE5\x8F\xB0\xE5\xBC\x8F…’ fo 分析如下: 首先通过语句 ...

  8. mysql DOS中中文乱码 ERROR 1366 (HY000): Incorrect string value: '\xC4\xEA\xBC\xB6' for column 'xxx' at row 1

    问题:ERROR (HY000): Incorrect string value: 在DOS中插入或查询中文出现乱码 登入mysql,输入命令:show variables like '%char%' ...

  9. ERROR 1366 (HY000): Incorrect string value: '\xE9\x83\x91\xE5\xB7\x9E' for column 'aa' at row 1 MySQL 字符集

    ERROR 1366 (HY000): Incorrect string value: '\xE9\x83\x91\xE5\xB7\x9E' for column 'aa' at row 1创建表之后 ...

随机推荐

  1. 用bower命令创建项目

    1,先安装bower,npm install -g bower 2,cd到项目文件夹下,安装项目所需要的依赖包,比如 npm install jquery;npm install bootstrap, ...

  2. ng-bind的使用

    由于JS是单线程的,当HTML页面执行alert的时候,会中断下面代码的运行,所以为了良好的用户体验,当需要在页面使用{{name}}的时候,通常不这样直接输出,而是用ng-bind绑定model数据 ...

  3. jquery判断div滚动条到底部

    jQuery 里和滚动条有关的概念很多,但是有三个属性和滚动条的拖动有关,就是:scrollTop.scrollLeft.scrollHeight.其中 scrollHeight 属性,互联网上几乎搜 ...

  4. PHP mcrypt加密扩展使用总结

    在开发中,很多时候我们在前后端交互中需要对一些敏感数据进行一定的加密.PHP中有提供了mcrypt的这样一个加密扩展实现对数据的加密解密. 一.mcrypt扩展的安装 在低版本的PHP中需要在配置文件 ...

  5. 使用EasyUI要引入哪些文件

    使用EasyUI,一般需要导入如下文件 <link rel="stylesheet" type="text/css" href="../reso ...

  6. Linux Shell编程二

    以"``"符号包含的内容不是字符串,而是代表这是一个shell命令. echo "today is" `date` 前面是字符,后面`date`表示执行date ...

  7. MySQL server has gone away的解决方法

    用Python写了一个http服务,需要从mysql读数据库,第一天还好好的,第二天突然不行了.报错如下: pymysql.err.OperationalError: (2006, 'MySQL se ...

  8. GEOS库的学习之一:介绍和编译

    对GEOS库的学习,源于一个项目:要在c++中判断二维平面中两个多边形的关系(无论凹凸).也就是判断两个多边形是否相交.相容等.听起来很简单,可实现起来却比较难,而项目又催得紧.于是我去搜索了一下,看 ...

  9. [CareerCup] 11.4 Sort the File 文件排序

    11.4 Imagine you have a 20 GB file with one string per line. Explain how you would sort the file. 这道 ...

  10. JDSideMenu实现(整块)侧滑功能,主视图会和状态栏(StatusBar)会一起滑动。

    JDSideMenu 实现侧边菜单功能,支持手势滑动.跟一般的侧边菜单不一样的是,滑动主视图,主视图会和状态栏(StatusBar)会一起滑动. demo 自行下载