Exception in Tkinter callback Traceback (most recent call last): File "D:\python\lib\tkinter\__init__.py", line 1892, in __call__ return self.func(*args) File "D:\桌面\mx_B\March\高景报料界面.py", line 46, in auto_insert1 cursor.execute("INSERT INTO (name, age, email) bool (?, ?, ?)") File "D:\python\lib\site-packages\pymysql\cursors.py", line 148, in execute result = self._query(query) File "D:\python\lib\site-packages\pymysql\cursors.py", line 310, in _query conn.query(q) File "D:\python\lib\site-packages\pymysql\connections.py", line 548, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "D:\python\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result result.read() File "D:\python\lib\site-packages\pymysql\connections.py", line 1156, in read first_packet = self.connection._read_packet() File "D:\python\lib\site-packages\pymysql\connections.py", line 725, in _read_packet packet.raise_for_error() File "D:\python\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error err.raise_mysql_exception(self._data) File "D:\python\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception raise errorclass(errno, errval) 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 '(name, age, email) bool (?, ?, ?)' at line 1")
时间: 2023-09-04 15:12:36 浏览: 369
Tkinter基本入门文字教程.zip_29F_Tkinter_python gui_python tkinter
这是一个 Python 中使用 PyMySQL 操作 MySQL 数据库时出现的错误。错误信息显示 SQL 语句存在语法错误,检查一下 SQL 语句的语法是否正确。根据错误信息,可能是 INSERT INTO 语句中字段名的格式不正确,或者是 VALUES 关键字缺失等问题导致的。建议将 SQL 语句拆分成多行,逐行检查语法是否正确。
阅读全文