Home > other >  Python access MySQL database update statement times timeout error
Python access MySQL database update statement times timeout error

Time:11-12

The code is:
SQL="UPDATE denglu SET shenBaoZhuangTai=1 WHERE gongSiId=" + STR (gongsi. GongSiId)
Mysql. Update (SQL)
After joining together of SQL and can run
Error message is as follows:
Traceback (the most recent call last) :
The File "main. Py", line 226, in & lt; module>
Data=https://bbs.csdn.net/topics/main (denglu gongsi, startTime)
The File "main. Py", line 151, in the main
Mysql. Update (SQL)
The File "F: \ Small - scale \ util \ mysql \ mysql py", line 37, in the update
_res=cursor. The execute (SQL)
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python36 \ lib \ site -p
Ackages \ pymysql \ your cursors py, line 170, "in the execute
Result=self. _query (query)
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python36 \ lib \ site -p
Ackages \ pymysql \ your cursors py, line 328, "in _query
Conn. Query (q)
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python36 \ lib \ site -p
Ackages \ pymysql \ connections py, line 517, "in the query
Self. _affected_rows=self. _read_query_result (unbuffered=unbuffered)
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python36 \ lib \ site -p
Ackages \ pymysql \ connections py, line 732, "in _read_query_result
Result. The read ()
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python36 \ lib \ site -p
Ackages \ pymysql \ connections py, line 1075, "in the read
First_packet=self. Connection. _read_packet ()
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python36 \ lib \ site -p
Ackages \ pymysql \ connections py, line 657, "in _read_packet
Packet_header=self. _read_bytes (4)
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python36 \ lib \ site -p
Ackages \ pymysql \ connections py, line 699, "in _read_bytes
"Lost connection to MySQL server during query (% s)" % (e))
Pymysql. Err. OperationalError: (2013, 'Lost connection to MySQL server during que
Ry ([10060] WinError because the connected party after a period of time there is no correct answer or connection host response, even
Try to fail,) ')
  • Related