码迷,mamicode.com
首页 > 数据库 > 详细

SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.

时间:2018-01-03 13:51:16      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:mysql5.5   gen   app   error   dos   5.6   you   body   数据   

服务器操作系统:LINUX

服务器环境:nginx1.4.7

php版本:php5.6.9

mysql版本:mysql5.5.34-log

开源框架:tpshop

报错详情:

SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.

搜索到的解决办法:

application/database.php中第28行

// 数据库连接参数
‘params‘         => [],

修改如下

// 数据库连接参数
‘params‘         => array(
        ‘1002‘  =>  "SET NAMES utf8",   #initial query
        ‘1000‘  =>  true,               #PDO::MYSQL_ATTR_USE_BUFFERED_QUERY
),

修改后就不在报这个错误了

SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.

标签:mysql5.5   gen   app   error   dos   5.6   you   body   数据   

原文地址:https://www.cnblogs.com/haixiaoxing/p/8183044.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!