(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
程序员文章站
2022-07-14 10:29:02
...
完整的语法错误是这样的:
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 ‘)’ at line 10”)
原代码
import pymysql
db = pymysql.connect("localhost",'root','700719trying','DOUBANMOVIE')
cursor = db.cursor()
cursor.execute("DROP TABLE IF EXISTS MOVIE")
sql = """CREATE TABLE MOVIE(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '自增 id',
name1 VARCHAR(1024),
rank BIGINT(4),
info VARCHAR(1024),
rating FLOAT,
num BIGINT(4),
quote VARCHAR(1024),
img_url VARCHAR(1024),
)
"""
cursor.execute(sql)
db.close()
错误原因:粗心
在创建最后一个变量时,后面多加了一个「,」
细心细心,弄清楚最基本的语法规则
上一篇: MySql-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v
下一篇: Netty入门5
推荐阅读
-
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
-
check the manual that corresponds to your MySQL server version for the right syntax的错误解析,correspondssyntax