插件用的是官方的webman-thinkorm
但運(yùn)行1分鐘左右,就會(huì)莫名其妙的報(bào)下面這個(gè)錯(cuò),我的ORM數(shù)據(jù)連接是用插件鏈接的,但ORM還是會(huì)報(bào)這個(gè)錯(cuò),而且我的鏈接用戶名也不是root
你的thinkorm到底用的是哪個(gè)配置?
ThinkORM插件的bootStrap
<?php
namespace Webman\ThinkOrm;
use Webman\Bootstrap;
use Workerman\Timer;
use think\facade\Db;
class ThinkOrm implements Bootstrap
{
// 進(jìn)程啟動(dòng)時(shí)調(diào)用
public static function start($worker)
{
// 配置
Db::setConfig(config('thinkorm'));
// 維持mysql心跳
if ($worker) {
Timer::add(55, function () {
$connections = config('thinkorm.connections', []);
foreach ($connections as $key => $item) {
if ($item['type'] == 'mysql') {
Db::connect($key)->query('select 1');
}
}
});
}
}
}
你如果要使用你config/plugin/hxxx/thinkorm的配置,手動(dòng)繼承一個(gè)Bootstrap,把start方法里獲取配置的地方改一下,然后修改config/bootstrap.php內(nèi)原ThinkORM::class的為你新繼承的