[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 1930
  8. at Query->getPk() in Query.php line 2605
  9. at Query->find() in C.php line 428
  10. at C::getMidById() in C.php line 184
  11. at C->show() in Content.php line 27
  12. at Content->show()
  13. at ReflectionMethod->invokeArgs() in App.php line 348
  14. at App::invokeMethod() in App.php line 612
  15. at App::module() in App.php line 461
  16. at App::exec() in App.php line 139
  17. at App::run() in start.php line 19
  18. at require('/www/wwwroot/vege365...') in index.php line 29

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

user_sid
0015807772
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
vege365.com
PATH_INFO
/xuefo/1483327791/
REDIRECT_STATUS
200
SERVER_NAME
vege365.com
SERVER_PORT
443
SERVER_ADDR
172.17.8.146
REMOTE_PORT
48408
REMOTE_ADDR
35.173.181.0
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/vege365
DOCUMENT_URI
/index.php
REQUEST_URI
/xuefo/1483327791/
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/xuefo/1483327791/
SCRIPT_FILENAME
/www/wwwroot/vege365/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711718497.4555
REQUEST_TIME
1711718497
Environment Variables
empty

ThinkPHP Constants

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