已解决 (156, b“Incorrect syntax near the keyword ‘group’.DB-Lib error message 20018, severity 15:\nGene
成功解决:(156, b"Incorrect syntax near the keyword ‘group’.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")
报错问题
粉丝群里面的一个小伙伴想用python读取数据库却发生了报错(当时他心里瞬间凉了一大截,跑来找我求助,然后顺利帮助他解决了,顺便记录一下希望可以帮助到更多遇到这个bug不会解决的小伙伴),报错代码如下:
# 插入sql语句
sql = "insert into test4 (name,group) values (%s,%s)"
#执行插入操作
cursor.executemany(sql,dict)
db.commit()
报错信息如下所示:
(156, b"Incorrect syntax near the keyword 'group'.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")
报错翻译
报错信息翻译:
(156,b“关键字“group”附近的语法不正确。DB Lib错误消息20018,严重性15:\n一般SQL Server错误:检查来自SQL Server的消息”)
报错原因
报错原因:
自定义字段名与数据库中的默认字段冲突,keyword ‘group’
,小伙伴们用下面的方法即可解决问题!!
解决方法
解决办法:
更改数据库列名(例如改为 “groups”)和 代码更改为groups即可
以上是此问题报错原因的解决方法,欢迎评论区留言讨论是否能解决,如果有用欢迎点赞收藏文章谢谢支持,博主才有动力持续记录遇到的问题!!!
千人全栈VIP答疑群联系博主帮忙解决报错
由于博主时间精力有限,每天私信人数太多,没办法每个粉丝都及时回复,所以优先回复VIP粉丝,可以通过订阅限时9.9付费专栏《100天精通Python从入门到就业》进入千人全栈VIP答疑群,获得优先解答机会(代码指导、远程服务),白嫖80G学习资料大礼包,专栏订阅地址:https://blog.csdn.net/yuan2019035055/category_11466020.html
-
优点:作者优先解答机会(代码指导、远程服务),群里大佬众多可以抱团取暖(大厂内推机会),此专栏文章是专门针对零基础和需要进阶提升的同学所准备的一套完整教学,从0到100的不断进阶深入,后续还有实战项目,轻松应对面试!
-
专栏福利:简历指导、招聘内推、每周送实体书、80G全栈学习视频、300本IT电子书:Python、Java、前端、大数据、数据库、算法、爬虫、数据分析、机器学习、面试题库等等
-
注意:如果希望得到及时回复,和大佬们交流学习,订阅专栏后私信博主进千人VIP答疑群
相关文章
- error the @annotation pointcut expression is only supported at Java 5 compliance level or above 异常解决
- 【COCOS2DX-LUA 脚本开发之七】解决( ERROR IN FUNCTION ‘ADDCHILD’. ARGUMENT #2 IS ‘XX’; ‘CCNODE’ EXPECTED. )异常报错的方法
- 【解决】Listener refused the connection with the following error 错误解决
- 解决 docker 报错: Error starting daemon: error initializing graphdriver: backing file system is unsupported for this graph driver
- an error occurred during the file system check错误的解决
- 解决svn log显示no author,no date的方法之一
- C语言/C++常见习题问答集锦(十八)烟花程序为什么不能放烟花(亲测解决,与大家分享)
- 成功解决label_error >= 0 && label_error < static_cast<int>(nclass) MultiClassEvaluation: label must be i
- 成功解决torchcuda__init__.py“, line 208, in check_error raise Cuda Error(res) torch.cuda.Cuda Error: C
- 成功解决Error: Cannot find module 'web3'
- 成功解决An error ocurred while starting the kernel
- 成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
- 成功解决Ubuntu下的include/darknet.h:14:14: fatal error: cuda_runtime.h: No such file or directory
- 已解决ERROR:pip‘s dependancy reselver does not currently take into acout all the pakages that are insta
- 已解决ERROR: pip’s dependency resolver does not currently take into account all the packages that are i
- 已解决ERROR: Could not find a version that satisfies the requirement opencv-python4.5.5.62A (from versi
- 已解决SystemError: returned a result with an error set
- 已解决ERROR: pip’s dependency resolver does not currently take into account all the packages that are
- 已解决ERROR: Failed building wheel for wxPython
- 已解决WARNING: There was an error checking the latest version of pip.
- 已解决ERROR: pip‘s dependency resolver does not currently take into account all the packages that are i
- 已解决ERROR: No matching distribution found for cv2
- 关于appium踩坑 :Encountered internal error running command: Error: Cannot verify the signature of (已解决)
- 1064 - You have an error in your SQL syntax问题解决
- 解决Error creating bean with name ‘mappingJackson2HttpMessageConverter‘ defined in class path resource
- 解决登录druid监控首页时出现Whitelabel Error Page:There was an unexpected error (type=Not Found, status=404)的错误
- 解决Error starting ApplicationContext.To display the conditions report re-run your application xxx的问题
- [转]解决Mysql InnoDB: Failing assertion: ret || !assert_on_error问题
- git 解决push报错:[rejected] master -> master (fetch first) error: failed to push some refs to
- 问题解决:Job for docker.service failed because the control process exited with error code