不能执行sql语句:pymysql.err.InterfaceError: (0, '')

在每次运行sql之前,ping一次,如果连接断开就重连。

connect.ping(reconnect=True)
cursor.execute(sql)
connect.commit()

posted @ 2021-08-19 16:22  布都御魂  阅读(322)  评论(0)    收藏  举报