python链接mysql出错:_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax;

AI权益加码!Claude Code、Cursor等20+工具免费用! 购周边限时加赠Coding Plan Lite,畅享主流AI工具!学习进阶更高效! 阅读详情

这个问题发生在我做的项目中的一个内容。处理数据,然后写入mysql数据库中。

报错情况:

_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's qpopper allows remote attackers to gain root access using a long PASS command.' at line 1")

解决思路:

刚开始报错出现下面这种情况,于是我就各种百度,然后也没查不出来具体的原因。

然后我就把要产生的待处理的数据在Navicat中插入看看能否正常执行。

这不是老问题吗?单双引号的问题!!!

于是就又找到了我另外一篇博客:https://blog.csdn.net/Homewm/article/details/81665511

结果问题就解决了!!!

 

 

python连接Mysql错误:_mysql_exceptions.OperationalError: (1054, "Unknown column 'CVE' in 'field lis解决办法 _mysql_exceptions.OperationalError: (1054, "Unknown column 'CVE' in 'field list'") (1)错误:#1054 - Unknown column 'CVE' in 'field list'   primaryTable_info_insert = "INSERT INTO primaryTable (cve_... 阅读详情

相关推荐

Error:1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL

错误代码: 1064 创建表的时候报这个错误,其实一般这种错误就是写sql 的时候符号有错误。 这时候我们单独运行特定的一句话,就会发现具体的错误点在哪。 1064错误简单点就是你的sql语句格式有问题,符号的错误。 ...

Ice Point. 4926

pymysql 报错 pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax

1.报错使用了:pymysql.escape_string()可以解决字符串转化单双引号的问题 2.第一种方法需要排查出那个字符串有问题,可以打印出sql语句查看,发现字符串中只有一个双引号的问题(本人遇到的问题字符串中有一个左上双引号),解决这个问题的方法是找到对应的词加上第一步的方法。 3.最好的方法就是所有都加上pymysql.escape_string()的方法,避免其他在遇到此类问题! ...

网络爬虫开发 1万+

SQL查询1064报错 [ERR] 1064 - You have an error in your SQL syntax; check the manual.......

MySQL建表出现1064问题问题 SQL语句 DROP DATABASE IF EXISTS bookstore; DROP DATABASE bookstore; USE bookstore; CREATE TABLE t_user ( 'id' INT PRIMARY KEY auto_increment, 'username' VARCHAR ( 20 ) NOT NULL UNIQUE, 'password' VARCHAR ( 32 ) NOT NULL, 'email' VARCHA

凌云 24万+

python mysql错误:pymysql.err.ProgrammingError: 1064, “You have an error in your SQL syntax

在向数据库插入数据时,执行报错,如下 看似提示为sql语法错误,排查了之后,觉得语法是没有问题的。看到网上有人遇到这个错误是插入语句的字符问题,尝试了pymysql.escape_string,但是提示pymysql没有该属性,后来将desc用str转换,依旧报错,而且本身插入字段也是str类型,后来查询时mysql保留字的原因,想到我的同事提醒我desc是保留字,尝试对desc用反引号``也就是esc键下面的符号引起来,终于成功 在使用、查询数据库字段或者表创建等,避免使用保留字,具体保留字参考另一篇

weixin_44371927的博客 5674

pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that co

对于报错解析:很明显这是语法错误,我上看下看,左看右看,都没有看出问题来。在pycharm中执行报语法错误,但是我复制到mysql数据库去执行又是正常的。就很纳闷。

c_lanxiaofang的博客 1万+

SQL语句异常:1064 - You have an error in your SQL syntax

SQL语句异常:1064 - You have an error in your SQL syntax

weixin_43720152的博客 4368

pymysql模块:pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check

想用pymysql操作mysql,使用了以下代码运行出现了错误 import pymysql.cursors # 连接到数据库 connection = pymysql.connect(host='localhost', user='root', password='111', database='myemployees',

qq_43312279的博客 1万+

sql语句 异常 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

在我们开发的工程中,有时候会报 [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面我只说我经常犯的一种错误。当然还有很多种错误,我们遇到再说。 查看之后,发现时from单词拼写错误,改正之后就可以

qq_41160301的博客 1万+

解决数据库报错[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

解决数据库报错[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

weixin_58018467的博客 2万+

python mysql 异常_python MySQLdb常见异常

一、前言最近在运行python脚本的时候,经常出现:mysql server has gone away的错误,导致脚本停止运行。只是代码里面明明已经使用try: except 这种方式来捕获mysql错误了,用的方法是:MySQLdb.ProgrammingError,但是毛用没用。 很好,很强大,那么咱们就来研究下这到底是怎么回事。捕获代码:try:cursor.execute(sql)exc...

weixin_28718345的博客 1138

Python:使用MySQLdb.connect出现错误:_mysql_exceptions.OperationalError: (2002,

使用Python脚本连接数据时,遇到以下错误: [root@Joe system]# python test.py   File "test.py", line 149, in <module>     db=MySQLdb.connect("localhost", "root", "kdc", "nms")   File "/usr/lib64/python2.7/

qq_42609381的博客 4641

解决mysql报错信息1064, You have an error in your SQL syntax

已知mysql的报错信息为:1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server MySQL1064错误是SQL语句写的有问题时出现的,即SQL的语法错误。那么一定是你的sql语句写的不规范或者写错了,可以看看关键字段是否有什么问题(与mysql自带字段冲突等),或者某一个函数用错等,总之就是sql语句写的有错误,可以单独提出来放到可视化查询工具审查审查 ...

何必说 4万+

pymysql.err.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that co

pymysql.err.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 在python3 pymysql将数据写入数据库中的时候...

weixin_44708030的博客 4471

SQL错误(1064):You have an error in your SQL syntax; check the manual that corresponds to your MySQL

mysql 中报错: SQL错误(1064):You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHAR2(32) NOT NULL comment 'P', Ywlx number(5) comment '业务类型', Ywid' at line 2

落队的飞行兵 4万+

错误代码: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser

删除时,要在delete 与 from 之间加上 表的别名,这样用别名才不会报错 DELETE t FROM iot_bustype_sensortype_relation t WHERE id IN (1,2)

reee112的博客 6197

sql语句 异常 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

在我们开发的工程中,有时候会报 [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面...

taiguolaotu的博客 138万+

sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1064, “You have an error in your SQ

sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fromt_user' at line 1")

m0_61884675的博客 1880
上一篇: python向mysql数据库中写入的数据出现单引号和双引号处理方法
下一篇: _mysql_exceptions.IntegrityError: (1062, "Duplicate entry 'CVE-2001-0358-half:[u'1573']' for key问题
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值