[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=zmcmscont...', 'zmcms_control', 'M72FJJpryajtH5mD', [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 `s...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('`shouquan`') in Query.php line 1921
  7. at Query->getTableInfo('shouquan', 'type') in Query.php line 1969
  8. at Query->getFieldsType('shouquan') in Query.php line 1975
  9. at Query->getFieldsBind('shouquan') in Builder.php line 270
  10. at Builder->buildWhere([], ['table' => 'shouquan', 'where' => [], 'field' => '*', ...]) in Builder.php line 240
  11. at Builder->parseWhere([], ['table' => 'shouquan', 'where' => [], 'field' => '*', ...]) in Builder.php line 719
  12. at Builder->select(['table' => 'shouquan', 'where' => [], 'field' => '*', ...]) in Query.php line 2511
  13. at Query->select() in Base.php line 17
  14. at Base->_initialize() in Controller.php line 59
  15. at Controller->__construct(object(Request))
  16. at ReflectionClass->newInstanceArgs([object(Request)]) in App.php line 359
  17. at App::invokeClass('app\index\controller...') in Loader.php line 479
  18. at Loader::controller('show', 'controller', false, 'Error') in App.php line 580
  19. at App::module(['index', 'show', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  20. at App::exec(['type' => 'module', 'module' => ['index', 'show', 'index'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  21. at App::run() in start.php line 19
  22. at require('/www/wwwroot/shhanp....') in index.php line 18

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
SCRIPT_NAME
/index.php
REQUEST_URI
/skf_jiaojiechu/12577.html
QUERY_STRING
s=/skf_jiaojiechu/12577.html
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/2.0
GATEWAY_INTERFACE
CGI/1.1
REDIRECT_QUERY_STRING
s=/skf_jiaojiechu/12577.html
REDIRECT_URL
/skf_jiaojiechu/12577.html
REMOTE_PORT
51132
SCRIPT_FILENAME
/www/wwwroot/shhanp.com/index.php
SERVER_ADMIN
webmaster@example.com
CONTEXT_DOCUMENT_ROOT
/www/wwwroot/shhanp.com/
CONTEXT_PREFIX
REQUEST_SCHEME
https
DOCUMENT_ROOT
/www/wwwroot/shhanp.com/
REMOTE_ADDR
3.135.248.144
SERVER_PORT
443
SERVER_ADDR
172.23.203.196
SERVER_NAME
www.shhpskf.com
SERVER_SOFTWARE
Apache
SERVER_SIGNATURE
<address>Apache Server at www.shhpskf.com Port 443</address>
LD_LIBRARY_PATH
/www/server/apache/lib
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_HOST
www.shhpskf.com
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
*/*
proxy-nokeepalive
1
H2_STREAM_TAG
192-5
H2_STREAM_ID
5
H2_PUSHED_ON
H2_PUSHED
H2_PUSH
off
H2PUSH
off
HTTP2
on
SSL_TLS_SNI
www.shhpskf.com
HTTPS
on
SCRIPT_URI
https://www.shhpskf.com/skf_jiaojiechu/12577.html
SCRIPT_URL
/skf_jiaojiechu/12577.html
REDIRECT_STATUS
200
REDIRECT_H2_STREAM_TAG
192-5
REDIRECT_H2_STREAM_ID
5
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSH
off
REDIRECT_H2PUSH
off
REDIRECT_HTTP2
on
REDIRECT_SSL_TLS_SNI
www.shhpskf.com
REDIRECT_HTTPS
on
REDIRECT_SCRIPT_URI
https://www.shhpskf.com/skf_jiaojiechu/12577.html
REDIRECT_SCRIPT_URL
/skf_jiaojiechu/12577.html
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1746034225.8848
REQUEST_TIME
1746034225
PATH_INFO
/skf_jiaojiechu/12577.html
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/shhanp.com/zmapp/
ROOTDIR
/www/wwwroot/shhanp.com/
THINK_VERSION
5.0.24
THINK_START_TIME
1746034225.8852
THINK_START_MEM
375792
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/shhanp.com/zmphp/
LIB_PATH
/www/wwwroot/shhanp.com/zmphp/library/
CORE_PATH
/www/wwwroot/shhanp.com/zmphp/library/think/
TRAIT_PATH
/www/wwwroot/shhanp.com/zmphp/library/traits/
ROOT_PATH
/www/wwwroot/shhanp.com/
EXTEND_PATH
/www/wwwroot/shhanp.com/extend/
VENDOR_PATH
/www/wwwroot/shhanp.com/vendor/
RUNTIME_PATH
/www/wwwroot/shhanp.com/./data/runtime/
LOG_PATH
/www/wwwroot/shhanp.com/./data/runtime/log/
CACHE_PATH
/www/wwwroot/shhanp.com/./data/runtime/cache/
TEMP_PATH
/www/wwwroot/shhanp.com/./data/runtime/temp/
CONF_PATH
/www/wwwroot/shhanp.com/zmapp/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false