你看到了吗_mysql_exceptions.OperationalError“查询期间与MySQL服务器的连接中断"被忽略了 [英] have you seen? _mysql_exceptions.OperationalError "Lost connection to MySQL server during query" being ignored

查看:299
本文介绍了你看到了吗_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

这篇关于你看到了吗_mysql_exceptions.OperationalError“查询期间与MySQL服务器的连接中断"被忽略了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆