[2002] PDOException in Connection.php line 295

SQLSTATE[HY000] [2002] Connection refused

  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...', 'root', 'SQLroot!2)9', [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 `d...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('`dp_sets`') in Query.php line 1921
  7. at Query->getTableInfo('dp_sets', 'type') in Query.php line 1969
  8. at Query->getFieldsType('dp_sets') in Query.php line 1975
  9. at Query->getFieldsBind('dp_sets') in Builder.php line 270
  10. at Builder->buildWhere(['AND' => ['name' => ['eq', 'mail']]], ['multi' => ['AND' => ['name' => [['eq', 'mail']]]], 'where' => ['AND' => ['name' => ['eq', 'mail']]], 'field' => ['content'], ...]) in Builder.php line 240
  11. at Builder->parseWhere(['AND' => ['name' => ['eq', 'mail']]], ['multi' => ['AND' => ['name' => [['eq', 'mail']]]], 'where' => ['AND' => ['name' => ['eq', 'mail']]], 'field' => ['content'], ...]) in Builder.php line 719
  12. at Builder->select(['multi' => ['AND' => ['name' => [['eq', 'mail']]]], 'where' => ['AND' => ['name' => ['eq', 'mail']]], 'field' => ['content'], ...]) in Query.php line 2462
  13. at Query->getPdo() in Query.php line 441
  14. at Query->value('content') in diy.php line 16
  15. at include('/home/wb001/www/hbxg...') in Config.php line 80
  16. at Config::load('/home/wb001/www/hbxg...', 'diy') in App.php line 262
  17. at App::init() in App.php line 182
  18. at App::initCommon() in App.php line 82
  19. at App::run() in start.php line 19
  20. at require('/home/wb001/www/hbxg...') in index.php line 17

Environment Variables

GET Data

s
/JiaoGaiDongTai.html
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_HOST
www.hbxggz.cn
HTTP_ACCEPT_ENCODING
gzip, br, zstd, deflate
HTTP_USER_AGENT
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT
*/*
PATH_INFO
REDIRECT_STATUS
200
SERVER_NAME
hbxggz.cn
SERVER_PORT
443
SERVER_ADDR
172.16.11.12
REMOTE_PORT
56031
REMOTE_ADDR
216.73.216.22
SERVER_SOFTWARE
nginx/1.18.0
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/home/wb001/www/hbxggz.cn_mhxe
DOCUMENT_URI
/index.php
REQUEST_URI
/JiaoGaiDongTai.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/JiaoGaiDongTai.html
SCRIPT_FILENAME
/home/wb001/www/hbxggz.cn_mhxe/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1769671393.6214
REQUEST_TIME
1769671393
Environment Variables
empty

ThinkPHP Constants

ROOT
/
APP_PATH
/home/wb001/www/hbxggz.cn_mhxe/application/
THINK_VERSION
5.0.23
THINK_START_TIME
1769671393.6215
THINK_START_MEM
357224
EXT
.php
DS
/
THINK_PATH
/home/wb001/www/hbxggz.cn_mhxe/core/
LIB_PATH
/home/wb001/www/hbxggz.cn_mhxe/core/library/
CORE_PATH
/home/wb001/www/hbxggz.cn_mhxe/core/library/think/
TRAIT_PATH
/home/wb001/www/hbxggz.cn_mhxe/core/library/traits/
ROOT_PATH
/home/wb001/www/hbxggz.cn_mhxe/
EXTEND_PATH
/home/wb001/www/hbxggz.cn_mhxe/extend/
VENDOR_PATH
/home/wb001/www/hbxggz.cn_mhxe/vendor/
RUNTIME_PATH
/home/wb001/www/hbxggz.cn_mhxe/runtime/
LOG_PATH
/home/wb001/www/hbxggz.cn_mhxe/runtime/log/
CACHE_PATH
/home/wb001/www/hbxggz.cn_mhxe/runtime/cache/
TEMP_PATH
/home/wb001/www/hbxggz.cn_mhxe/runtime/temp/
CONF_PATH
/home/wb001/www/hbxggz.cn_mhxe/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false