[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=172.18.0....', 'admin', 'sDd8ao6Gij2H3sdHo5iH...', [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 `w...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('weight') in Query.php line 1921
  7. at Query->getTableInfo('weight', 'type') in Query.php line 1969
  8. at Query->getFieldsType('weight') in Query.php line 1975
  9. at Query->getFieldsBind('weight') in Builder.php line 270
  10. at Builder->buildWhere(['AND' => ['b.isdel' => 2, 'b.audit' => ['neq', 3], 'a.cid' => ['in', [205, 204, 207]]]], ['table' => 'weight', 'alias' => ['weight' => 'b'], 'join' => [[['website' => 'a'], 'LEFT', 'a.url_id=b.url_id']], ...]) in Builder.php line 240
  11. at Builder->parseWhere(['AND' => ['b.isdel' => 2, 'b.audit' => ['neq', 3], 'a.cid' => ['in', [205, 204, 207]]]], ['table' => 'weight', 'alias' => ['weight' => 'b'], 'join' => [[['website' => 'a'], 'LEFT', 'a.url_id=b.url_id']], ...]) in Builder.php line 719
  12. at Builder->select(['table' => 'weight', 'alias' => ['weight' => 'b'], 'join' => [[['website' => 'a'], 'LEFT', 'a.url_id=b.url_id']], ...]) in Query.php line 2462
  13. at Query->getPdo() in Query.php line 441
  14. at Query->value('COUNT(*) AS tp_count', 0, true) in Query.php line 576
  15. at Query->aggregate('COUNT', '*', true) in Query.php line 551
  16. at Query->count() in Query.php line 1484
  17. at Query->paginate(10) in IndexModel.php line 498
  18. at IndexModel->getid('ysdm', 1, 10, null) in Index.php line 673
  19. at Index->ranklist()
  20. at ReflectionMethod->invokeArgs(object(Index), []) in App.php line 343
  21. at App::invokeMethod([object(Index), 'ranklist'], []) in App.php line 611
  22. at App::module(['index', 'index', 'ranklist'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 457
  23. at App::exec(['type' => 'module', 'module' => ['index', 'index', 'ranklist'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  24. at App::run() in start.php line 19
  25. at require('/data0/www/2898/v3.3...') in index.php line 21

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/data0/www/2898/v3.3.3/public/index.php
QUERY_STRING
s=/webmain/ysdm.htm
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/webmain/ysdm.htm
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/data0/www/2898/v3.3.3/public
SERVER_PROTOCOL
HTTP/1.0
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.16.1
REMOTE_ADDR
43.248.188.38
REMOTE_PORT
47422
SERVER_ADDR
172.18.0.101
SERVER_PORT
33664
SERVER_NAME
2898.com
REDIRECT_STATUS
200
PHP_ADMIN_VALUE
open_basedir=/data0/www/2898/v3.3.3/public/:/tmp/:/proc/:/data0/www/2898/
HTTP_HOST
www.2898.com
HTTP_X_REAL_IP
175.29.243.172
HTTP_X_FORWARDED_FOR
175.29.243.172
HTTP_REMOTE_HOST
175.29.243.172
HTTP_CONNECTION
close
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_ACCEPT
*/*
HTTP_ACCEPT_ENCODING
deflate, gzip
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1606719873.8055
REQUEST_TIME
1606719873
PATH_INFO
/webmain/ysdm.htm
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/data0/www/2898/v3.3.3/public/../application/
CONF_PATH
/data0/www/2898/v3.3.3/public/../conf/
APP_STATE
dev
THINK_VERSION
5.0.24
THINK_START_TIME
1606719873.8067
THINK_START_MEM
262976
EXT
.php
DS
/
THINK_PATH
/data0/www/2898/v3.3.3/thinkphp/
LIB_PATH
/data0/www/2898/v3.3.3/thinkphp/library/
CORE_PATH
/data0/www/2898/v3.3.3/thinkphp/library/think/
TRAIT_PATH
/data0/www/2898/v3.3.3/thinkphp/library/traits/
ROOT_PATH
/data0/www/2898/v3.3.3/
EXTEND_PATH
/data0/www/2898/v3.3.3/extend/
VENDOR_PATH
/data0/www/2898/v3.3.3/vendor/
RUNTIME_PATH
/data0/www/2898/v3.3.3/runtime/
LOG_PATH
/data0/www/2898/v3.3.3/runtime/log/
CACHE_PATH
/data0/www/2898/v3.3.3/runtime/cache/
TEMP_PATH
/data0/www/2898/v3.3.3/runtime/temp/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
CONTROLLER_NAME
index
MODULE_NAME
index
ACTION_NAME
ranklist