尝试从python的mysql表中删除行时出现错误1064

时间:2019-07-02 07:30:48

标签: python mysql mysql-python pymysql

我将pymysql与python 3.7.3和MySQL 8.0一起使用。

我尝试删除一行:

sql_delete = "DELETE FROM %s WHERE new_id=%s"
self.cursor.execute(sql_delete , [table_name,  this_id])

我得到一个错误:

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 ''the_table' WHERE new_id=3' at line 1")

这是怎么了?

0 个答案:

没有答案