你看到了吗_mysql_exceptions.OperationalError“查询期间与MySQL服务器的连接中断"被忽略了

问题描述:

我刚开始使用适用于python的MySQLdb模块,并在运行一些SELECT和UPDATE查询后,将获得以下输出:

I am just starting out with the MySQLdb module for python, and upon running some SELECT and UPDATE queries, the following gets output:

例外 _mysql_exceptions.OperationalError:(2013,'与MySQL的连接中断 查询中的服务器")的绑定方法Cursor. del 位于0x8c0188c的MySQLdb.cursors.Cursor对象被忽略

Exception _mysql_exceptions.OperationalError: (2013, 'Lost connection to MySQL server during query') in bound method Cursor.del of MySQLdb.cursors.Cursor object at 0x8c0188c ignored

异常显然被MySQLdb本身捕获(并忽略"),所以我想这不是主要问题.此外,SELECT会生成结果,并且表将通过UPDATE进行修改.

The exception is apparently getting caught (and "ignored") by MySQLdb itself, so I guess this is not a major issue. Also, the SELECTs generate results and the table gets modified by UPDATE.

但是,由于我只是对此感到不知所措,所以我想问:此消息是否表明我做错了什么?还是您以前在无害的情况下看到过这些警告?

But, since I am just getting my feet wet with this, I want to ask: does this message suggest I am doing something wrong? Or have you seen these warnings before in harmless situations?

感谢您的见识,

lara

哈!刚意识到我试图在关闭连接后使用游标 !无论如何,写得很好! :)

Ha! Just realized I was trying to use the cursor after having closed the connection! In any case, it was nice writing! : )

l