[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...', 'estrongchem_com', 'aNLrcnFmedRGHHEr', [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 `y...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('`yc_cms_archives`') in Query.php line 1921
  7. at Query->getTableInfo('yc_cms_archives', 'type') in Query.php line 1969
  8. at Query->getFieldsType('yc_cms_archives') in Query.php line 1975
  9. at Query->getFieldsBind('yc_cms_archives') in Builder.php line 270
  10. at Builder->buildWhere(['AND' => ['status' => 'normal', 'deletetime' => ['exp', object(Expression)]]], ['soft_delete' => ['__TABLE__.deletetime', ['null', '']], 'via' => '', 'with' => ['channel'], ...]) in Builder.php line 240
  11. at Builder->parseWhere(['AND' => ['status' => 'normal', 'deletetime' => ['exp', object(Expression)]]], ['soft_delete' => ['__TABLE__.deletetime', ['null', '']], 'via' => '', 'with' => ['channel'], ...]) in Builder.php line 725
  12. at Builder->select(['soft_delete' => ['__TABLE__.deletetime', ['null', '']], 'via' => '', 'with' => ['channel'], ...]) in Query.php line 2511
  13. at Query->select() in Query.php line 1487
  14. at Query->paginate('10', true, ['type' => '\addons\cms\library\...', 'var_page' => 'page', 'list_rows' => 15, ...]) in Archives.php line 484
  15. at Archives::getArchivesList(['cache' => false, 'paginate' => '10,true,page']) in Index.php line 30
  16. at Index->index()
  17. at call_user_func_array([object(Index), 'index'], []) in Route.php line 78
  18. at Route->execute('cms', 'index', 'index')
  19. at ReflectionMethod->invokeArgs(object(Route), ['cms', 'index', 'index']) in App.php line 343
  20. at App::invokeMethod(['\think\addons\Route', 'execute'], ['case' => 'archive', 'act' => 'list', 'catid' => '20', ...]) in App.php line 470
  21. at App::exec(['type' => 'method', 'method' => ['\think\addons\Route', 'execute'], 'var' => ['addon' => 'cms', 'controller' => 'index', 'action' => 'index']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  22. at App::run() in start.php line 19
  23. at require('/www/wwwroot/estrong...') in index.php line 23

Environment Variables

GET Data

case
archive
act
list
catid
20
POST Data
empty
Files
empty

Cookies

think_var
en
PHPSESSID
32f1m785fb00dpjn8dqaaj8er3
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_COOKIE
think_var=en; PHPSESSID=32f1m785fb00dpjn8dqaaj8er3
HTTP_ACCEPT_ENCODING
gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.estrongchem.com
HTTP_USER_AGENT
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
PATH_INFO
REDIRECT_STATUS
200
SERVER_NAME
estrongchem.com
SERVER_PORT
443
SERVER_ADDR
10.61.9.133
REMOTE_PORT
56326
REMOTE_ADDR
45.38.45.2
SERVER_SOFTWARE
nginx/1.20.1
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/estrongchem.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/index.php?case=archive&act=list&catid=20
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
case=archive&act=list&catid=20
SCRIPT_FILENAME
/www/wwwroot/estrongchem.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1722049290.1112
REQUEST_TIME
1722049290
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/estrongchem.com/public/../application/
THINK_VERSION
5.0.24
THINK_START_TIME
1722049290.1117
THINK_START_MEM
405808
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/estrongchem.com/thinkphp/
LIB_PATH
/www/wwwroot/estrongchem.com/thinkphp/library/
CORE_PATH
/www/wwwroot/estrongchem.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/estrongchem.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/estrongchem.com/
EXTEND_PATH
/www/wwwroot/estrongchem.com/extend/
VENDOR_PATH
/www/wwwroot/estrongchem.com/vendor/
RUNTIME_PATH
/www/wwwroot/estrongchem.com/runtime/
LOG_PATH
/www/wwwroot/estrongchem.com/runtime/log/
CACHE_PATH
/www/wwwroot/estrongchem.com/runtime/cache/
TEMP_PATH
/www/wwwroot/estrongchem.com/runtime/temp/
CONF_PATH
/www/wwwroot/estrongchem.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
FILTER_VALIDATE_BOOL
258
ADDON_PATH
/www/wwwroot/estrongchem.com/addons/