出现这个错误的原因是,数据库的编码格式为latin1 而我要将utf8的中文插入到数据库中。

mysql> alter database  xxx default character set utf8;

进入mysql,mysql -u root -p,输入show variables like '%character%' ; 查看字符集

SHOW VARIABLES LIKE 'char%';

修改文件

/etc/mysql/mysql.conf.d/mysqld.cnf

打开mysqld.cnf 文件,在lc-messages-dir = /usr/share/mysql 语句后添加 character-set-server=utf8 语句

这个时候 migrate 仍然会出错,那就删除之前建立的数据库,重新新建 database,,再migrate成功。

"Incorrect string value: '\\xE7\\x89\\x8C\\xE5\\xB1\\x80...' for column 'name' at row 1")的更多相关文章

  1. Mysql 插入中文错误:Incorrect string value: '\xE7\xA8\x8B\xE5\xBA\x8F...' for column 'course' at row 1

    create table my_user (    id tinyint(4) not null auto_increment,    account varchar(255) default nul ...

  2. nested exception is java.sql.SQLException: Incorrect string value: '\xE7\x99\xBB\xE9\x99\x86...' for column 'image' at row 1

    HTTP Status 500 - Hibernate operation: could not insert: [cn.itcast.shop.product.vo.Product]; uncate ...

  3. MySQL数据库插入中文时出现Incorrect string value: '\xE6\x97\xB7\xE5\x85\xA8' for column 'sz_name' at row 1

    今天在开发时候出现了这个问题 Incorrect string value: '\xE6\x97\xB7\xE5\x85\xA8' for column 'sz_name' at row 1 场景,往 ...

  4. mysql导入数据库出现:Incorrect string value: '\xE7\x82\xB9\xE9\x92\x9F' for column 'chinese' at row 1

    mysql导入数据库出现:Incorrect string value: '\xE7\x82\xB9\xE9\x92\x9F' for column 'chinese' at row 1 使用 sho ...

  5. Incorrect string value: '\xE7\x8E\x8B\xE4\xBD\xB3' for column 'contact' at row 1

    1 queries executed, 0 success, 1 errors, 0 warnings 查询:INSERT INTO beijing(contact,tel_phone,qq,comp ...

  6. django更换数据库时提示"django.db.utils.InternalError: (1366, "Incorrect string value: '\\xE7\\x94\\xA8\\xE6\\x88\\xB7' for column 'name' at row 1")"

    问题提出 昨天在运行django时,初始化使用的是自带的数据库,后来更换mysql数据库,数据库同步之后,打开mysql无法添加数据,插入数据时,提示django.db.utils.InternalE ...

  7. 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创建表之后 ...

  8. mysql插入报错:java.sql.SQLException: Incorrect string value: '\xE6\x9D\xAD\xE5\xB7\x9E...' for column 'address' at row 1

    界面报错: 日志报错: java.sql.SQLException: Incorrect at com.mysql.cj.jdbc.exceptions.SQLError.createSQLExcep ...

  9. mysql 5.5及以前版本的编码问题“Incorrect string value: '\xE6\x9B\xB9\xE5\x86\xAC...' for column 'realname' at row 1”

    遇到这个问题,所有的编码都设为utf8了,还是没有用,各种乱码,后来发现这是mysql自己的问题,它在5.5及之前的版本只支持3字节的utf8编码,出现4字节的utf编码时出现错误,参考: http: ...

随机推荐

  1. 【Mac常用shell】

    1. 杀掉占用某端口的进程: lsof -i:9000  ->  确认PID kill PID 2. 环境变量: 直接用{PATH}:路径 的办法,经常不好用,我的解决办法: vi ~/.bas ...

  2. JavaScript的知识基本介绍

    ECMAScript js简单介绍(与java的区别)        1.语法(区分大小写,弱类型,分号可写可不写)        2.变量(只能使用var定义,要么不定义,如果在函数内部使用var定 ...

  3. ng的概念层次(官方文档摘录)

    官方文档是这么说的: You write Angular applications by: composing HTML templates with Angularized markup, writ ...

  4. GitHub 中国区前 100 名到底是什么样的人?

    转一下CSDN的文章, 这里有些人挺厉害的. http://geek.csdn.net/news/detail/66000

  5. 20170706xlVBA城中村改造汇总

    Public Sub GatherDataPicker() Application.ScreenUpdating = False Application.DisplayAlerts = False A ...

  6. Mass Change Queries CodeForces - 911G (线段树合并)

    链接 大意: 给定序列, 每次操作将区间[l,r]中的x全改为y, 最后输出序列 权值范围比较小, 对每个权值开一颗线段树, 每次将x合并到y上即可 #include <iostream> ...

  7. C#窗体控件简介ListBox(需整理)

    ListBox 控件 ListBox 控件又称列表框,它显示一个项目列表供用户选择.在列表框中,用户 一次可以选择一项,也可以选择多项. 1.常用属性: (1) Items属性: 用于存放列表框中的列 ...

  8. Eclipse修改已存在的SVN地址

    1.Window---->Show View---->Other...

  9. 87. Scramble String *HARD* 动态规划

    Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrin ...

  10. 33. 81. Search in Rotated Sorted Array *HARD*

    Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 migh ...