webman-admin数据库配置报错

xcq

问题描述

根据webman-admin手册 ,在【入门指引】/【安装】/第3步

访问 http://127.0.0.1:8787/app/admin/ 完成数据库相关配置

填好数据库信息后,报错:

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. (SQL: -- -- Dumping data for table `wa_admin_roles` -- LOCK TABLES `wa_admin_roles` WRITE)

自行网上搜索相关信息,在webman/config/database.php中添加:

'params'=>[
                                PDO::ATTR_CASE => PDO::CASE_LOWER,
                                PDO::ATTR_EMULATE_PREPARES => true,
                                ],

问题依然存在。

去数据库里查看表信息,发现有一张表:wa_admin_roles

报错信息

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. (SQL: -- -- Dumping data for table `wa_admin_roles` -- LOCK TABLES `wa_admin_roles` WRITE)

操作系统及workerman/webman等框架组件具体版本

操作系统:ubuntu LTS 20.04
框架:webman
插件:webman-admin

977 1 0
1个回答

walkor 打赏

plugin/admin/app/controller/InstallController.phpgetPdo() 方法$params里加 \PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, 试下

  • xcq 2023-04-02

    首先非常感谢!
    没有InstallController.php这个文件,需要自建吗?

  • xcq 2023-04-02

    找到了,plugin/admin/app/controller/common/InstallController.php

年代过于久远,无法发表回答
×
🔝