[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...', 'fast_7haocha_com', 'mNakjAL6P24TtDj6', [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', 'pk') in Query.php line 1955
  8. at Query->getPk(['multi' => ['AND' => ['diyname' => ['login']]], 'where' => ['AND' => ['diyname' => 'login']], 'table' => 'fa_cms_channel', ...]) in Query.php line 2640
  9. at Query->find() in Query.php line 89
  10. at Query->__call('getByDiyname', ['login'])
  11. at call_user_func_array([object(Query), 'getByDiyname'], ['login']) in Model.php line 2207
  12. at Model::__callStatic('getByDiyname', ['login']) in Channel.php line 29
  13. at Channel->index()
  14. at call_user_func_array([object(Channel), 'index'], []) in Route.php line 78
  15. at Route->execute('cms', 'channel', 'index')
  16. at ReflectionMethod->invokeArgs(object(Route), ['cms', 'channel', 'index']) in App.php line 343
  17. at App::invokeMethod(['\think\addons\Route', 'execute'], ['diyname' => 'login', 'addon' => 'cms', 'controller' => 'channel', ...]) in App.php line 470
  18. at App::exec(['type' => 'method', 'method' => ['\think\addons\Route', 'execute'], 'var' => ['addon' => 'cms', 'controller' => 'channel', 'action' => 'index']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  19. at App::run() in start.php line 19
  20. at require('/www/wwwroot/fast.7h...') in index.php line 73

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
www.7haocha.com
PATH_INFO
/login
REDIRECT_STATUS
200
SERVER_NAME
fast.7haocha.com
SERVER_PORT
443
SERVER_ADDR
154.64.117.91
REMOTE_PORT
49822
REMOTE_ADDR
35.168.113.41
SERVER_SOFTWARE
nginx/1.22.0
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/www/wwwroot/fast.7haocha.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/login
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/login
SCRIPT_FILENAME
/www/wwwroot/fast.7haocha.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1710821831.3474
REQUEST_TIME
1710821831
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/fast.7haocha.com/public/../application/
THINK_VERSION
5.0.25
THINK_START_TIME
1710821831.3478
THINK_START_MEM
415704
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/fast.7haocha.com/thinkphp/
LIB_PATH
/www/wwwroot/fast.7haocha.com/thinkphp/library/
CORE_PATH
/www/wwwroot/fast.7haocha.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/fast.7haocha.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/fast.7haocha.com/
EXTEND_PATH
/www/wwwroot/fast.7haocha.com/extend/
VENDOR_PATH
/www/wwwroot/fast.7haocha.com/vendor/
RUNTIME_PATH
/www/wwwroot/fast.7haocha.com/runtime/
LOG_PATH
/www/wwwroot/fast.7haocha.com/runtime/log/
CACHE_PATH
/www/wwwroot/fast.7haocha.com/runtime/cache/
TEMP_PATH
/www/wwwroot/fast.7haocha.com/runtime/temp/
CONF_PATH
/www/wwwroot/fast.7haocha.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
FILTER_VALIDATE_BOOL
258
ADDON_PATH
/www/wwwroot/fast.7haocha.com/addons/