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

Posted 海小兴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are activ相关的知识,希望对你有一定的参考价值。

服务器操作系统: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 activ的主要内容,如果未能解决你的问题,请参考以下文章

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

SQLSTATE[HY000]: General error: 1114 The table '/home/mysql/data3007/tmp/#sq

解决mysql的错误 CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1300 Inva

解决SQLSTATE[HY000]: General error: 2006 MySQL server has gone away问题的方法

SQLSTATE[HY000] [1049] 未知数据库 'laravel'

SQLSTATE[HY000] [2002] 连接被拒绝 |