[2002] PDOException in Connection.php line 293

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 293
  2. at PDO->__construct() in Connection.php line 293
  3. at Connection->connect() in Connection.php line 990
  4. at Connection->initConnect() in Connection.php line 346
  5. at Connection->query() in Mysql.php line 65
  6. at Mysql->getFields() in Query.php line 1896
  7. at Query->getTableInfo() in Query.php line 815
  8. at Query->field() in Query.php line 462
  9. at Query->column() in Label.php line 111
  10. at Label::get_tag_data_cfg() in LabelShow.php line 1251
  11. at LabelShow->get_label() in Label.php line 235
  12. at Label::run_label() in common.php line 77
  13. at fun() in a20b57717cb0c444458ff269beb62d5f.php line 8
  14. at include('/www/wwwroot/orgcncn...') in File.php line 53
  15. at File->read() in Template.php line 189
  16. at Template->fetch() in Think.php line 86
  17. at Think->fetch() in View.php line 163
  18. at View->fetch() in Controller.php line 120
  19. at Controller->fetch() in Base.php line 424
  20. at Base->fetch() in Category.php line 10
  21. at Category->index()
  22. at ReflectionMethod->invokeArgs() in App.php line 348
  23. at App::invokeMethod() in App.php line 612
  24. at App::module() in App.php line 461
  25. at App::exec() in App.php line 139
  26. at App::run() in start.php line 19
  27. at require('/www/wwwroot/orgcncn...') in index.php line 29

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

user_sid
2c6b59f649
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
org-cn.cn
PATH_INFO
/q/zhichangbaike
REDIRECT_STATUS
200
SERVER_NAME
org-cn.cn
SERVER_PORT
443
SERVER_ADDR
172.17.8.146
REMOTE_PORT
54332
REMOTE_ADDR
3.235.76.155
SERVER_SOFTWARE
nginx/1.25.4
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/www/wwwroot/orgcncn
DOCUMENT_URI
/index.php
REQUEST_URI
/q/zhichangbaike
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/q/zhichangbaike
SCRIPT_FILENAME
/www/wwwroot/orgcncn/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711718496.5905
REQUEST_TIME
1711718496
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/orgcncn/application/
ENTRANCE
index
THINK_VERSION
5.0.18
THINK_START_TIME
1711718496.5908
THINK_START_MEM
357672
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/orgcncn/thinkphp/
LIB_PATH
/www/wwwroot/orgcncn/thinkphp/library/
CORE_PATH
/www/wwwroot/orgcncn/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/orgcncn/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/orgcncn/
EXTEND_PATH
/www/wwwroot/orgcncn/extend/
VENDOR_PATH
/www/wwwroot/orgcncn/vendor/
RUNTIME_PATH
/www/wwwroot/orgcncn/runtime/
LOG_PATH
/www/wwwroot/orgcncn/runtime/log/
CACHE_PATH
/www/wwwroot/orgcncn/runtime/cache/
TEMP_PATH
/www/wwwroot/orgcncn/runtime/temp/
CONF_PATH
/www/wwwroot/orgcncn/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
HTMLPURIFIER_PREFIX
/www/wwwroot/orgcncn/vendor/ezyang/htmlpurifier/library
FIRST_LOAD
true
TEMPLATE_PATH
/www/wwwroot/orgcncn/template/
IS_POST
false
PUBLIC_URL
/public/
PUBLIC_PATH
/www/wwwroot/orgcncn/public/
UPLOAD_URL
/public/uploads/
UPLOAD_PATH
/www/wwwroot/orgcncn/public/uploads/
STATIC_URL
/public/static/
STATIC_PATH
/www/wwwroot/orgcncn/public/static/
PLUGINS_PATH
/www/wwwroot/orgcncn/plugins/
CACHE_DIR
/www/wwwroot/orgcncn/runtime/
QUN
Resource
ADMIN_FILENAME
pptop.php
LOAD_INDEXBASE
true
IN_TEMPLATE
true