[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=localhost...', 'xiangchenjitu', 'ndFf85CZKieJE8Wc', [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 `b...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('bloglink') in Query.php line 1921
  7. at Query->getTableInfo('bloglink', 'type') in Query.php line 1969
  8. at Query->getFieldsType('bloglink') in Query.php line 1975
  9. at Query->getFieldsBind('bloglink') in Builder.php line 270
  10. at Builder->buildWhere(['AND' => ['nav' => ['eq', '友情链接']]], ['multi' => ['AND' => ['nav' => [['eq', '友情链接']]]], 'where' => ['AND' => ['nav' => ['eq', '友情链接']]], 'table' => 'bloglink', ...]) in Builder.php line 240
  11. at Builder->parseWhere(['AND' => ['nav' => ['eq', '友情链接']]], ['multi' => ['AND' => ['nav' => [['eq', '友情链接']]]], 'where' => ['AND' => ['nav' => ['eq', '友情链接']]], 'table' => 'bloglink', ...]) in Builder.php line 719
  12. at Builder->select(['multi' => ['AND' => ['nav' => [['eq', '友情链接']]]], 'where' => ['AND' => ['nav' => ['eq', '友情链接']]], 'table' => 'bloglink', ...]) in Query.php line 2511
  13. at Query->select() in Index.php line 16
  14. at Index->__construct()
  15. at ReflectionClass->newInstanceArgs([]) in App.php line 359
  16. at App::invokeClass('app\index\controller...') in Loader.php line 479
  17. at Loader::controller('index', 'controller', false, 'Error') in App.php line 581
  18. at App::module(['index', 'index', 'djdtxq'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 457
  19. at App::exec(['type' => 'module', 'module' => ['index', 'index', 'djdtxq']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  20. at App::run() in start.php line 19
  21. at require('/home/wwwroot/xiangc...') in index.php line 17

Environment Variables

GET Data

/index/index/djdtxq/id/528_html
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
REDIRECT_STATUS
200
proxy-nokeepalive
1
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_HOST
www.xiangchenjt.com
HTTP_ACCEPT
*/*
HTTP_ACCEPT_ENCODING
deflate, gzip
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH
/www/server/apache/lib
SERVER_SIGNATURE
<address>Apache Server at www.xiangchenjt.com Port 80</address>
SERVER_SOFTWARE
Apache
SERVER_NAME
www.xiangchenjt.com
SERVER_ADDR
211.149.212.192
SERVER_PORT
80
REMOTE_ADDR
154.210.125.7
DOCUMENT_ROOT
/www/wwwroot/xiangchenjituan
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/www/wwwroot/xiangchenjituan
SERVER_ADMIN
webmaster@example.com
SCRIPT_FILENAME
/www/wwwroot/xiangchenjituan/index.php
REMOTE_PORT
20000
REDIRECT_URL
/index/index/djdtxq/id/528.html
REDIRECT_QUERY_STRING
/index/index/djdtxq/id/528.html
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
REQUEST_METHOD
GET
QUERY_STRING
/index/index/djdtxq/id/528.html
REQUEST_URI
/index/index/djdtxq/id/528.html
SCRIPT_NAME
/index.php
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1618650513.7795
REQUEST_TIME
1618650513
PATH_INFO
/index/index/djdtxq/id/528.html
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/home/wwwroot/xiangchenjituan/application/
THINK_VERSION
5.0.24
THINK_START_TIME
1618650513.7806
THINK_START_MEM
263568
EXT
.php
DS
/
THINK_PATH
/home/wwwroot/xiangchenjituan/thinkphp/
LIB_PATH
/home/wwwroot/xiangchenjituan/thinkphp/library/
CORE_PATH
/home/wwwroot/xiangchenjituan/thinkphp/library/think/
TRAIT_PATH
/home/wwwroot/xiangchenjituan/thinkphp/library/traits/
ROOT_PATH
/home/wwwroot/xiangchenjituan/
EXTEND_PATH
/home/wwwroot/xiangchenjituan/extend/
VENDOR_PATH
/home/wwwroot/xiangchenjituan/vendor/
RUNTIME_PATH
/home/wwwroot/xiangchenjituan/runtime/
LOG_PATH
/home/wwwroot/xiangchenjituan/runtime/log/
CACHE_PATH
/home/wwwroot/xiangchenjituan/runtime/cache/
TEMP_PATH
/home/wwwroot/xiangchenjituan/runtime/temp/
CONF_PATH
/home/wwwroot/xiangchenjituan/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false