mysqlconnector-python出现Unread result found错误
来源:互联网 发布:spin.js 编辑:程序博客网 时间:2024/06/08 10:50
电脑重装了一遍,之前环境是好像python3.3+connector2.0.0,之前代码没有问题,后来重装过后,无论是python2.7还是3.3还是3.4连接任意connector版本都会出现“mysql connection not available”的错误,而且都是在cnn.cursor()这个方法这儿,用try except语句块包裹过后,发现实际错误是“unread result found”百度了半天解决办法,还是overstackflow以及这位小哥的解决办法更有启发性(什么把所有的结果集都fetch一遍,我要改的地方太多了),还是采用了直接把链接改成buffered的方法解决。
config={'host':'127.0.0.1',#default localhost 'user':'root', 'password':'buaascse', 'port':3306 ,#默认即为3306 #'database':'mobilephone', 无默认数据库 'charset':'utf8',#默认即为utf8 'buffered': True, } try: cnn = mysql.connector.connect(**config) except mysql.connector.Error as e: print('connect fails!{}'.format(e))
这么做似乎是把结果集缓存在服务器端,不知道数据量太大请求太多的时候会不会造成服务器端负荷过大卡死的情况。不过对于我这种本地小项目来说肯定是没啥影响。
0 0
- mysqlconnector-python出现Unread result found错误
- python操作mysql 抛出Unread result found的处理方法
- mysql数据库的unread result found异常
- win10,python2.7,mysql-connector-python 报错 mysql.connector.errors.InternalError: Unread result found
- Python中的MySQLConnector使用介绍
- 安装Python mysqlclient出现“OSError: mysql_config not found”错误
- Python 的MySQLConnector模块使用方法详解
- Python中MySQLConnector模块使用方法详解
- ssh常见错误一(result 'null' not found)小结
- python安装软件出现错误 fatal error: 'libxml/xmlversion.h' file not found
- Python出现编码错误
- 安装python出现错误
- python字符串和变量相加时出现,coercing to unicode need string or buffer nonetype found python 错误的解决
- [解决]在安装Python PIL 时出现错误: Python version 2.7 required, which was not found in the registry
- Tomcat出现Column cannot found的错误
- vs2005出现错误:'AfxLoadLibrary': identifier not found
- thinkphp 出现Class 'PDO' not found 错误
- python字符串和变量相加时出现,coercing to unicode need string or buffer ?? found 错误的解决
- windows下python36+nltk
- openCV—彩色图像R、G、B分量的提取与合并及其相关颜色空间的转化
- 解决不同逻辑电平的兼容问题
- 安装apache2.4
- 3、Java入门—继承
- mysqlconnector-python出现Unread result found错误
- Linux 支持C++11
- Kotlin - 基本数据类型
- 数据库知识整理——经典SQL语句
- bootstrap-datepicker使用总结
- RedHat Enterprise Linux 7关闭防火墙方法
- WebRTC第三步:在客户端用shadowsocks作网络代理
- 别因为要学的太多反而压垮自己
- [深度学习论文笔记][Image Classification] Identity Mappings in Deep Residual Networks