pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that co
程序员文章站
2022-04-22 12:10:02
问题描述:Django数据管理((python/mysql))-yaml封装初始化数据python运行mysql_action.py脚本时报错: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 'groups)...
问题描述:
Django数据管理((python/mysql))-yaml封装初始化数据
python运行mysql_action.py脚本时报错: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 'groups) values('1','Sharon','sharon@163.com','http://127.0.0.1:8000/groups/1/')' at line 1")
原因解析:
mysql_action.py脚本中导入的初始化数据datas.yaml文件里的groups与MySQL的关键词冲突,导致执行insert语句报错。
解决方案:
把datas_yaml文件里面的groups字段改成:api_user.groups(即“表名.字段名”)即可解决关键字冲突问题。
本文地址:https://blog.csdn.net/DaisyCold/article/details/108257394
下一篇: 给定一个序列求指定位数的排列组合数
推荐阅读
-
pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that co
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
MySql-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v
-
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
Mysql错误:[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
-
SQL报错,You have an error in your SQL syntax; check the manual that corresponds to