[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 `g...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('goods_website') in Query.php line 1921
  7. at Query->getTableInfo('goods_website', 'type') in Query.php line 1969
  8. at Query->getFieldsType('goods_website') in Query.php line 1975
  9. at Query->getFieldsBind('goods_website') in Builder.php line 270
  10. at Builder->buildWhere(['AND' => ['url_id' => '290079', 'softdel' => 1, 'status' => ['in', [3, 5, 6, ...]], ...]], ['table' => 'goods_website', 'multi' => ['AND' => ['url_id' => ['290079'], 'softdel' => [1], 'status' => [['in', [3, 5, 6, ...]]], ...]], 'where' => ['AND' => ['url_id' => '290079', 'softdel' => 1, 'status' => ['in', [3, 5, 6, ...]], ...]], ...]) in Builder.php line 240
  11. at Builder->parseWhere(['AND' => ['url_id' => '290079', 'softdel' => 1, 'status' => ['in', [3, 5, 6, ...]], ...]], ['table' => 'goods_website', 'multi' => ['AND' => ['url_id' => ['290079'], 'softdel' => [1], 'status' => [['in', [3, 5, 6, ...]]], ...]], 'where' => ['AND' => ['url_id' => '290079', 'softdel' => 1, 'status' => ['in', [3, 5, 6, ...]], ...]], ...]) in Builder.php line 719
  12. at Builder->select(['table' => 'goods_website', 'multi' => ['AND' => ['url_id' => ['290079'], 'softdel' => [1], 'status' => [['in', [3, 5, 6, ...]]], ...]], 'where' => ['AND' => ['url_id' => '290079', 'softdel' => 1, 'status' => ['in', [3, 5, 6, ...]], ...]], ...]) in Query.php line 2511
  13. at Query->select() in Webdetails.php line 65
  14. at Webdetails->web_details()
  15. at ReflectionMethod->invokeArgs(object(Webdetails), []) in App.php line 343
  16. at App::invokeMethod([object(Webdetails), 'web_details'], []) in App.php line 611
  17. at App::module(['index', 'webdetails', 'web_details'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 457
  18. at App::exec(['type' => 'module', 'module' => ['index', 'webdetails', 'web_details'], 'convert' => false], ['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('/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=/website_290079.htm
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/website_290079.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
58308
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.240.249
HTTP_X_FORWARDED_FOR
175.29.240.249
HTTP_REMOTE_HOST
175.29.240.249
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
1606720104.1275
REQUEST_TIME
1606720104
PATH_INFO
/website_290079.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
1606720104.1288
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
webdetails
MODULE_NAME
index
ACTION_NAME
web_details