[2002] PDOException in Connection.php line 528

SQLSTATE[HY000] [2002] Connection refused

  1. try {
  2. if (empty($config['dsn'])) {
  3. $config['dsn'] = $this->parseDsn($config);
  4. }
  5. if ($config['debug']) {
  6. $startTime = microtime(true);
  7. }
  8. $this->links[$linkNum] = new PDO($config['dsn'], $config['username'], $config['password'], $params);
  9. if ($config['debug']) {
  10. // 记录数据库连接信息
  11. $this->log('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn']);
  12. }
  13. return $this->links[$linkNum];
  14. } catch (\PDOException $e) {
  15. if ($autoConnection) {

Call Stack

  1. in Connection.php line 528
  2. at PDO->__construct('mysql:host=127.0.0.1...', 'root', 'ZP7d8EHzLSLJSJca', [0, 2, 0, ...]) in Connection.php line 528
  3. at Connection->connect() in Connection.php line 2024
  4. at Connection->initConnect(false) in Connection.php line 644
  5. at Connection->query('SHOW COLUMNS FROM `c...', [], false, true) in Mysql.php line 90
  6. at Mysql->getFields('`cmf_hook`') in Connection.php line 377
  7. at Connection->getTableInfo('cmf_hook', 'bind') in Connection.php line 454
  8. at Connection->getFieldsBind('cmf_hook') in Builder.php line 292
  9. at Builder->buildWhere(object(Query), ['AND' => [['type', '=', 1]], 'OR' => [object(Closure)]]) in Builder.php line 264
  10. at Builder->parseWhere(object(Query), ['AND' => [['type', '=', 1]], 'OR' => [object(Closure)]]) in Builder.php line 998
  11. at Builder->select(object(Query)) in Connection.php line 1370
  12. at Connection->column(object(Query), ['hook'], '') in Query.php line 628
  13. at Query->column('hook') in InitHookBehavior.php line 37
  14. at InitHookBehavior->run(null)
  15. at ReflectionMethod->invokeArgs(object(InitHookBehavior), [null]) in Container.php line 373
  16. at Container->invokeMethod(['cmf\behavior\InitHoo...', 'run'], [null]) in Container.php line 411
  17. at Container->invoke(['cmf\behavior\InitHoo...', 'run'], [null]) in Hook.php line 208
  18. at Hook->execTag('cmf\behavior\InitHoo...', 'app_init', null) in Hook.php line 149
  19. at Hook->listen('app_init') in App.php line 425
  20. at App->run() in index.php line 51

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_REFERER https://0512ks.com/
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST www.0512ks.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.xxx.com
SERVER_PORT 443
SERVER_ADDR 172.20.255.198
REMOTE_PORT 51662
REMOTE_ADDR 44.192.132.66
SERVER_SOFTWARE nginx/1.22.1
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /mnt/thinkcmf/public
DOCUMENT_URI /index.php
REQUEST_URI /
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /mnt/thinkcmf/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711629279.6054
REQUEST_TIME 1711629279
Environment Variablesempty
ThinkPHP Constants
APP_DEBUG true
CMF_ROOT /mnt/thinkcmf/
CMF_DATA /mnt/thinkcmf/data/
APP_PATH /mnt/thinkcmf/app/
WEB_ROOT /mnt/thinkcmf/public/
FILTER_VALIDATE_BOOL 258
HTMLPURIFIER_PREFIX /mnt/thinkcmf/vendor/ezyang/htmlpurifier/library
0.039879s