不能执行sql语句:pymysql.err.InterfaceError: (0, '')
在每次运行sql之前,ping一次,如果连接断开就重连。
connect.ping(reconnect=True)
cursor.execute(sql)
connect.commit()
在每次运行sql之前,ping一次,如果连接断开就重连。
connect.ping(reconnect=True)
cursor.execute(sql)
connect.commit()