[1040] PDOException in Connection.php line 293

SQLSTATE[08004] [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 293
  2. at PDO->__construct('mysql:dbname=xiaobao...', 'xiaobao', 'Sr$ifO0s', [0, 2, 0, ...]) in Connection.php line 293
  3. at Connection->connect() in Connection.php line 969
  4. at Connection->initConnect(false) in Connection.php line 346
  5. at Connection->query('SHOW COLUMNS FROM `t...', [], false, true) in Mysql.php line 62
  6. at Mysql->getFields('tp_config') in Query.php line 1741
  7. at Query->getTableInfo('tp_config', 'type') in Query.php line 1789
  8. at Query->getFieldsType('tp_config') in Query.php line 1795
  9. at Query->getFieldsBind('tp_config') in Builder.php line 256
  10. at Builder->buildWhere([], ['field' => ['name', 'value', 'type'], 'table' => 'tp_config', 'where' => [], ...]) in Builder.php line 226
  11. at Builder->parseWhere([], ['field' => ['name', 'value', 'type'], 'table' => 'tp_config', 'where' => [], ...]) in Builder.php line 690
  12. at Builder->select(['field' => ['name', 'value', 'type'], 'table' => 'tp_config', 'where' => [], ...]) in Query.php line 2259
  13. at Query->getPdo() in Query.php line 462
  14. at Query->column('value,type', 'name')
  15. at call_user_func_array([object(Query), 'column'], ['value,type', 'name']) in Model.php line 2051
  16. at Model->__call('column', ['value,type', 'name']) in Config.php line 16
  17. at Config->column('value,type', 'name') in Config.php line 16
  18. at Config->getConfig() in Config.php line 28
  19. at Config->run(null, null) in Hook.php line 127
  20. at Hook::exec('app\common\behavior\...', 'app_init', null, null) in Hook.php line 88
  21. at Hook::listen('app_init') in App.php line 463
  22. at App::initCommon() in App.php line 75
  23. at App::run() in apl.php line 23

Environment Variables

GET Data
empty

POST Data

appid
cnshicai
token
ee25097186d99a3ef9735de6a3444d59
folder
a
detail
d
20190812
id
164
user
user
referer
xmh
Files
empty
Cookies
empty
Session
empty

Server/Request Data

UNIQUE_ID
XtL7GsQNVmzaJZqiNh4ZoQAAAHo
HTTP_X_REAL_IP
180.235.65.10
HTTP_X_FORWARDED_FOR
180.235.65.10
HTTP_HOST
xiaobao.31fabu.com
HTTP_CONNECTION
close
CONTENT_LENGTH
853
HTTP_USER_AGENT
netsun
HTTP_ACCEPT
*/*
CONTENT_TYPE
multipart/form-data; boundary=----------------------------e81eceadb9b9
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache
SERVER_NAME
xiaobao.31fabu.com
SERVER_ADDR
127.0.0.1
SERVER_PORT
80
REMOTE_ADDR
127.0.0.1
DOCUMENT_ROOT
/data/www/xiaobao/
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/data/www/xiaobao/
SERVER_ADMIN
web@netsun.com
SCRIPT_FILENAME
/data/www/xiaobao/apl.php
REMOTE_PORT
39608
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.0
REQUEST_METHOD
POST
QUERY_STRING
REQUEST_URI
/apl.php
SCRIPT_NAME
/apl.php
PHP_SELF
/apl.php
REQUEST_TIME_FLOAT
1590885146.286
REQUEST_TIME
1590885146
Environment Variables
empty

ThinkPHP Constants

BIND_MODULE
apl
DS
/
ROOT_PATH
/data/www/xiaobao/
THINK_PATH
/data/www/xiaobao/thinkphp/
APP_PATH
/data/www/xiaobao/application/
COMMON_PATH
/data/www/xiaobao/application/common/
CONF_PATH
/data/www/xiaobao/application/common/config/
ROOT_URL
/
THINK_VERSION
5.0.11
THINK_START_TIME
1590885146.2888
THINK_START_MEM
269840
EXT
.php
LIB_PATH
/data/www/xiaobao/thinkphp/library/
CORE_PATH
/data/www/xiaobao/thinkphp/library/think/
TRAIT_PATH
/data/www/xiaobao/thinkphp/library/traits/
EXTEND_PATH
/data/www/xiaobao/extend/
VENDOR_PATH
/data/www/xiaobao/vendor/
RUNTIME_PATH
/data/www/xiaobao/runtime/
LOG_PATH
/data/www/xiaobao/runtime/log/
CACHE_PATH
/data/www/xiaobao/runtime/cache/
TEMP_PATH
/data/www/xiaobao/runtime/temp/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
0