"Incorrect string value: '\\xE7\\x89\\x8C\\xE5\\xB1\\x80...' for column 'name' at row 1")
出现这个错误的原因是,数据库的编码格式为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")的更多相关文章
- 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 ...
- 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 ...
- 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 场景,往 ...
- 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 ...
- 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 ...
- 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 ...
- 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创建表之后 ...
- 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 ...
- 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: ...
随机推荐
- HDU 1686 Oulippo
http://acm.hdu.edu.cn/showproblem.php?pid=1686 题意:给定一个文本串和给定一个模式串,求文本串中有几个模式串. 思路:直接套用KMP模板. #includ ...
- c++ 匹配A容器中最先出现的b容器中的元素,返回iterator,(find_first_of)
#include <iostream> // std::cout #include <algorithm> // std::find_first_of #include < ...
- Ubuntu14.04(server amd 64)编译安装 ceres-solver
文档地址:http://www.ceres-solver.org/installation.html git地址:(需要FQ下载) git clone https://ceres-solver.goo ...
- Codeforces 894B - Ralph And His Magic Field
894B - Ralph And His Magic Field 思路: 当k为1时,如果n和m奇偶性不同,那么没有答案. 可以证明,在其他情况下有答案,且答案为2^(n-1)*(m-1),因为前n- ...
- Unity生成屏幕快照
public static Texture2D CaptureCamera(Camera camera, Rect rect) { RenderTexture rt = ); RenderTextur ...
- English trip M1 - PC12 I'd Like a Room Please Teacher:Taalan
In this lesson you will learn to say what you need. 在本课中,您将学习如何说出您的需求. Words list elevator 电梯 ...
- 【异常】redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'PSETEX'
在spring中 针对 RedisTemplate类: private RedisTemplate<String, String> template; 当调用下面方法 template.o ...
- WebView 实现JS效果和a标签的点击事件
目前很多android app都可以显示web页面的界面,嵌入式开发,这个界面一般都是WebView这个控件加载出来的,学习该控件可以为你的app开发提升扩展性. 先说下WebView的一些优点: 可 ...
- Windows Server2008安装mysql5.6出现程序无法正常启动(0xc000007b)
下载 到官网下载mysql5.6版本,msi安装包只有32位无64位 移动到指定文件夹下,解压文件 添加环境变量 变量名:MYSQL_HOME 变量值:C:\Program Files\mysql 即 ...
- php-fpm.conf配置文件中文说明详解及重要参数说明
摘自:https://www.jb51.net/article/148550.htm 感谢分享 php-fpm工作流程 php-fpm全名是PHP FastCGI进程管理器 php-fpm启动后会先读 ...