SQLSTATE[HY000]: General error: 2014

Hello,How to fix it up?

  • 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.

Hi,

What are you doing when this error occurs? Are you using any third party plugin?

Can you check the php error log to see which php file is causing this error?

Install piwik step 5: add a superuser error and report the above error. What should you do?

Hi, this is very odd. I guess you are trying to install the latest piwik version.
The last time someone had this error is three years ago: General error: 2014

What version of PHP and MySQL are you using?

You can try commenting out the line including $this->_connection->setAttribute in core/Db/Adapter/Pdo/Mysql.php and check if you are able to setup piwik this way.

        parent::_connect();
        // MYSQL_ATTR_USE_BUFFERED_QUERY will use more memory when enabled
        // $this->_connection->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
        $this->_connection->exec('SET sql_mode = "' . Db::SQL_MODE . '"');