[1040] PDOException in Connection.php line 295

SQLSTATE[HY000] [1040] Too many connections

  1. $this->fetchType = $config['result_type'];
  2. }
  3. try {
  4. if (empty($config['dsn'])) {
  5. $config['dsn'] = $this->parseDsn($config);
  6. }
  7. if ($config['debug']) {
  8. $startTime = microtime(true);
  9. }
  10. $this->links[$linkNum] = new PDO($config['dsn'], $config['username'], $config['password'], $params);
  11. if ($config['debug']) {
  12. // 记录数据库连接信息
  13. Log::record('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn'], 'sql');
  14. }
  15. } catch (\PDOException $e) {
  16. if ($autoConnection) {
  17. Log::record($e->getMessage(), 'error');
  18. return $this->connect($autoConnection, $linkNum);
  19. } else {

Call Stack

  1. in Connection.php line 295
  2. at PDO->__construct('mysql:host=127.0.0.1...', 'www_chinabbfx_co', 'ka5SAE56K375Jt4y', [0, 2, 0, ...]) in Connection.php line 295
  3. at Connection->connect() in Connection.php line 995
  4. at Connection->initConnect(false) in Connection.php line 348
  5. at Connection->query('SHOW COLUMNS FROM `f...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('`fa_cms_channel`') in Query.php line 1921
  7. at Query->getTableInfo('fa_cms_channel', 'type') in Query.php line 1969
  8. at Query->getFieldsType('fa_cms_channel') in Query.php line 1975
  9. at Query->getFieldsBind('fa_cms_channel') in Builder.php line 270
  10. at Builder->buildWhere(['AND' => ['parent_id' => ['>', 0], 'status' => ['eq', 'normal']]], ['multi' => ['AND' => ['parent_id' => [['>', 0]], 'status' => [['eq', 'normal']]]], 'where' => ['AND' => ['parent_id' => ['>', 0], 'status' => ['eq', 'normal']]], 'field' => ['parent_id'], ...]) in Builder.php line 240
  11. at Builder->parseWhere(['AND' => ['parent_id' => ['>', 0], 'status' => ['eq', 'normal']]], ['multi' => ['AND' => ['parent_id' => [['>', 0]], 'status' => [['eq', 'normal']]]], 'where' => ['AND' => ['parent_id' => ['>', 0], 'status' => ['eq', 'normal']]], 'field' => ['parent_id'], ...]) in Builder.php line 725
  12. at Builder->select(['multi' => ['AND' => ['parent_id' => [['>', 0]], 'status' => [['eq', 'normal']]]], 'where' => ['AND' => ['parent_id' => ['>', 0], 'status' => ['eq', 'normal']]], 'field' => ['parent_id'], ...]) in Query.php line 2462
  13. at Query->getPdo() in Query.php line 491
  14. at Query->column('parent_id') in Channel.php line 114
  15. at Channel->getHasChildAttr(null, ['id' => 22, 'type' => 'link', 'model_id' => 1, ...], []) in Model.php line 602
  16. at Model->getAttr('has_child') in Model.php line 2294
  17. at Model->offsetGet('has_child') in c3822d2cfcf73d719ae16a959f542e0a.php line 60
  18. at include('/www/wwwroot/www.chi...') in File.php line 53
  19. at File->read('/www/wwwroot/www.chi...', ['config' => ['system_user_id' => '0', 'sitename' => '暴风手游网', 'sitelogo' => '/uploads/20210726/48...', ...], 'user' => null, 'site' => ['name' => '暴风手游网', 'beian' => '', 'cdnurl' => '', ...], ...]) in Template.php line 188
  20. at Template->fetch('/www/wwwroot/www.chi...', ['config' => ['system_user_id' => '0', 'sitename' => '暴风手游网', 'sitelogo' => '/uploads/20210726/48...', ...], 'user' => null, 'site' => ['name' => '暴风手游网', 'beian' => '', 'cdnurl' => '', ...], ...], []) in Think.php line 86
  21. at Think->fetch('/www/wwwroot/www.chi...', ['config' => ['system_user_id' => '0', 'sitename' => '暴风手游网', 'sitelogo' => '/uploads/20210726/48...', ...], 'user' => null, 'site' => ['name' => '暴风手游网', 'beian' => '', 'cdnurl' => '', ...], ...], []) in View.php line 163
  22. at View->fetch('/index') in Index.php line 30
  23. at Index->index()
  24. at call_user_func_array([object(Index), 'index'], []) in Route.php line 76
  25. at Route->execute('cms', 'index', 'index')
  26. at ReflectionMethod->invokeArgs(object(Route), ['cms', 'index', 'index']) in App.php line 343
  27. at App::invokeMethod(['\think\addons\Route', 'execute'], ['addon' => 'cms', 'controller' => 'index', 'action' => 'index']) in App.php line 470
  28. at App::exec(['type' => 'method', 'method' => ['\think\addons\Route', 'execute'], 'var' => ['addon' => 'cms', 'controller' => 'index', 'action' => 'index']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  29. at App::run() in start.php line 19
  30. at require('/www/wwwroot/www.chi...') in index.php line 23

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_X_FORWARDED_FOR
3.235.199.19
HTTP_CONNECTION
keep-alive
HTTP_X_VIA
1.1 PSmgasbIAD1ak79:17 (Cdn Cache Server V2.0), 1.1 PSxgHK4jd171:7 (Cdn Cache Server V2.0)
HTTP_X_CDN_SRC_PORT
35208
HTTP_X_WS_REQUEST_ID
65f8fc0b_PSmgasbIAD1ak79_42673-25991
HTTP_CDN_SRC_IP
3.235.199.19
HTTP_REFERER
https://chinabbfx.com/
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
www.chinabbfx.com
PATH_INFO
REDIRECT_STATUS
200
SERVER_NAME
www.chinabbfx.com
SERVER_PORT
443
SERVER_ADDR
172.31.240.187
REMOTE_PORT
44656
REMOTE_ADDR
163.171.198.161
SERVER_SOFTWARE
nginx/1.14.2
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/www.chinabbfx.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
SCRIPT_FILENAME
/www/wwwroot/www.chinabbfx.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1710816267.3108
REQUEST_TIME
1710816267
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/www.chinabbfx.com/public/../application/
THINK_VERSION
5.0.24
THINK_START_TIME
1710816267.3112
THINK_START_MEM
420168
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/www.chinabbfx.com/thinkphp/
LIB_PATH
/www/wwwroot/www.chinabbfx.com/thinkphp/library/
CORE_PATH
/www/wwwroot/www.chinabbfx.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/www.chinabbfx.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/www.chinabbfx.com/
EXTEND_PATH
/www/wwwroot/www.chinabbfx.com/extend/
VENDOR_PATH
/www/wwwroot/www.chinabbfx.com/vendor/
RUNTIME_PATH
/www/wwwroot/www.chinabbfx.com/runtime/
LOG_PATH
/www/wwwroot/www.chinabbfx.com/runtime/log/
CACHE_PATH
/www/wwwroot/www.chinabbfx.com/runtime/cache/
TEMP_PATH
/www/wwwroot/www.chinabbfx.com/runtime/temp/
CONF_PATH
/www/wwwroot/www.chinabbfx.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
FILTER_VALIDATE_BOOL
258
ADDON_PATH
/www/wwwroot/www.chinabbfx.com/addons/
QINIU_FUNCTIONS_VERSION
7.2.10