解决pymysql.err.InternalError: (1366, "Incorrect string value: '\\xF0\\x9F\\x8C\\xB8' for column 'headline' at row 1")
解决pymysql.err.InternalError: (1366, "Incorrect string value: '\\xF0\\x9F\\x8C\\xB8' for column 'headline' at row 1")

当使用Python对MySQL数据库进行操作时,我们可能会遇到这种错误,这是因为编码所引起的错误,我们必须确保MySQL中的数据库中的编码支持utf8格式,才能将正常的中文格式的字符串插入到MySQL中,我们必须要确保如下character_set_server的格式为utf8,因为将中文插入到MySQL中,主要需要使用的是该驱动。

从图中可以看到,这里的character_set_server已经是utf8格式了。
解决pymysql.err.InternalError: (1366, "Incorrect string value: '\\xF0\\x9F\\x8C\\xB8' for column 'headline' at row 1")的更多相关文章
- Mysql失败,异常pymysql.err.InternalError: (1366, "Incorrect string value: '\\xF0\\x9D\\x90\\xBF;......
问题描述: 插入Mysql时失败了,python代码报如下异常: pymysql.err.InternalError: (1366, "Incorrect string value: '\\ ...
- python pymysql.err.InternalError: (1366, "Incorrect string value: '\\xE9\\x9F\\xA9\\xE6\\xA2\\x85...
python3使用pymysql报错: image.png 代码: #插入数据 try: sql = 'INSERT INTO classb (a_id,name,age) VALUES (6,& ...
- 彻底解决:java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\x94' for column 'name' at row 1
转载:https://blog.csdn.net/qq_31122833/article/details/83992085
- sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1366, "Incorrect string value: '\\xE6\\xB1\\x89\\xE8\\xAF\\xAD...' for column 'className' at row 1") [SQL: INSERT INTO classmessage (`classId
sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1366, "Incorrect string value: '\\xE ...
- Django1.10+Mysql 5.7存储emoji表情,报Incorrect string value: '\\xF0\\x9F\\x90\\xA8' for column 'signature' at row 1的解决方法
问题: 在做webapp项目的时候,用户提交emoji数据,控制台报错:Incorrect string value: '\\xF0\\x9F\\x90\\xA8' for column 'signa ...
- mysql 彻底解决:Incorrect string value: '\xF0\x9F\x98\xAD",...' for column 'commentContent' at row 1
彻底解决:Incorrect string value: '\xF0\x9F\x98\xAD",...' for column 'commentContent' at row 1 今天在爬取 ...
- java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\xB3' for column 'Content' at row 1
在尝试将 emoji 表情符号 插入MySQL数据库时,遇到以下错误信息: ### The error occurred while setting parameters ### SQL: INSER ...
- 表情存储异常--mybatis抛出异常(java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\x94' for column 'name' at row 1)
文章参考 https://blog.csdn.net/junsure2012/article/details/42171035 https://www.cnblogs.com/WangYunShuai ...
- mybatis抛出异常(java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\x94' for column 'name' at row 1)
文章参考 https://blog.csdn.net/junsure2012/article/details/42171035 https://www.cnblogs.com/WangYunShuai ...
随机推荐
- 323. Number of Connected Components in an Undirected Graph按照线段添加的并查集
[抄题]: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of n ...
- 读写大“二进制”文件,不必申请很大内存(fopen,fread,fwrite,fclose)
<?php /** * 读写大二进制文件,不必申请很大内存 * 只有读取到内容才创建文件 * 保证目录可写 * * @param string $srcPath 源文件路径 * @param s ...
- mybatis开发Dao的Mapper动态代理方式
1. 开发规范Mapper接口开发方法只需要程序员编写Mapper接口(相当于Dao接口),由Mybatis框架根据接口定义创建接口的动态代理对象,代理对象的方法体跟Dao原始方法中接口实现类的方法相 ...
- Windows pip安装失败:no module named pkg_resources
通常是Setuptools安装出错,下载以下ez_setup.py文件后,先执行:ez_setup.py -U setuptools 重新安装setuptools 通过此ez_setup.py pip ...
- http://www.atool.org/keytype.php#0-tsina-1-53371-397232819ff9a47a7b7e80a40613cfe1
http://www.atool.org/keytype.php#0-tsina-1-53371-397232819ff9a47a7b7e80a40613cfe1
- 使用cmd命令登录mysql数据库时报2013-Lost connection to MYSQL server at 'waiting for initial communication packet',system error:0
[错误内容]:SQL Error (2013): Lost connection to MySQL server at 'waiting for initial communication packe ...
- 以json格式打印实体类信息
1.pom.xml <dependency> <groupId>com.google.code.gson</groupId> <artifactId>g ...
- UILabel 字体下方加下划线
UILabel *knowKankan = [[UILabel alloc] initWithFrame:CGRectMake(0, MAINHEIGHT - 78 , MAINWIDTH, ...
- (模拟)Arithmetic Sequence -- HDU -- 5400
链接: http://acm.hdu.edu.cn/showproblem.php?pid=5400 Time Limit: 4000/2000 MS (Java/Others) Memory ...
- How do I determine if I'm being run under the debugger?
#include <assert.h>#include <stdbool.h>#include <sys/types.h>#include <unistd.h ...