国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

python這個(gè)錯(cuò)誤怎么處理pymysql.err.ProgrammingError: (1064, ’ at line 1")

瀏覽:178日期:2022-06-30 17:17:27

問題描述

root@iZbp1iqn00z9x3jov6bas1Z:/data/wwwlogs/www# python log1.pymultiprocessing.pool.RemoteTraceback:'''Traceback (most recent call last): File '/usr/lib/python3.5/multiprocessing/pool.py', line 119, in worker result = (True, func(*args, **kwds)) File '/usr/lib/python3.5/multiprocessing/pool.py', line 44, in mapstar return list(map(*args)) File 'log1.py', line 289, in main_loop create_table(table_name) File 'log1.py', line 87, in create_table con_cur.execute(creat_table.format(t_name)) File '/usr/local/lib/python3.5/dist-packages/pymysql/cursors.py', line 166, in execute result = self._query(query) File '/usr/local/lib/python3.5/dist-packages/pymysql/cursors.py', line 322, in _query conn.query(q) File '/usr/local/lib/python3.5/dist-packages/pymysql/connections.py', line 856, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File '/usr/local/lib/python3.5/dist-packages/pymysql/connections.py', line 1057, in _read_query_result result.read() File '/usr/local/lib/python3.5/dist-packages/pymysql/connections.py', line 1340, in read first_packet = self.connection._read_packet() File '/usr/local/lib/python3.5/dist-packages/pymysql/connections.py', line 1014, in _read_packet packet.check_error() File '/usr/local/lib/python3.5/dist-packages/pymysql/connections.py', line 393, in check_error err.raise_mysql_exception(self._data) File '/usr/local/lib/python3.5/dist-packages/pymysql/err.py', line 107, 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 ’’ at line 1')'''The above exception was the direct cause of the following exception:Traceback (most recent call last): File 'log1.py', line 326, in <module> p.map(main_loop, logs_list) File '/usr/lib/python3.5/multiprocessing/pool.py', line 260, in map return self._map_async(func, iterable, mapstar, chunksize).get() File '/usr/lib/python3.5/multiprocessing/pool.py', line 608, in get raise self._valuepymysql.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 1')

這個(gè)錯(cuò)誤怎么處理

python3.5.2

報(bào)錯(cuò)如下

日志格式

python這個(gè)錯(cuò)誤怎么處理pymysql.err.ProgrammingError: (1064, ’ at line 1")

問題解答

回答1:

看你的報(bào)錯(cuò)是SQL語句出錯(cuò),應(yīng)該是你換行符引起的sql語句換行建議用三個(gè)引號(hào)來,如

create_table = ''' sql語句'''回答2:

變量名: log_pattern_obj 沒有定義, 檢查下是不是打錯(cuò)字母或者忘記定義了

標(biāo)簽: Python 編程
主站蜘蛛池模板: 华蓥市| 百色市| 太康县| 五常市| 和平县| 勃利县| 宁津县| 衡水市| 阜宁县| 苏尼特右旗| 上饶县| 泽普县| 吉隆县| 明星| 重庆市| 同江市| 美姑县| 天长市| 天津市| 仁怀市| 花莲县| 台州市| 湟源县| 绥滨县| 保山市| 曲水县| 西盟| 资阳市| 新郑市| 双桥区| 建昌县| 上思县| 桑日县| 锡林郭勒盟| 康保县| 云安县| 苏尼特右旗| 游戏| 邹城市| 九龙城区| 铜川市|