[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() in Connection.php line 295
  3. at Connection->connect() in Connection.php line 995
  4. at Connection->initConnect() in Connection.php line 348
  5. at Connection->query() in Mysql.php line 65
  6. at Mysql->getFields() in Query.php line 1921
  7. at Query->getTableInfo() in Query.php line 1969
  8. at Query->getFieldsType() in Query.php line 1975
  9. at Query->getFieldsBind() in Builder.php line 270
  10. at Builder->buildWhere() in Builder.php line 240
  11. at Builder->parseWhere() in Builder.php line 720
  12. at Builder->select() in Query.php line 2511
  13. at Query->select() in Type.php line 47
  14. at Type->listData() in Type.php line 200
  15. at Type->listCacheData() in index.php line 138
  16. at include('/home/www/wwwroot/fi...') in common.php line 3319
  17. at seoRun() in MyError.php line 11
  18. at MyError->_empty()
  19. at ReflectionMethod->invokeArgs() in App.php line 343
  20. at App::invokeMethod() in App.php line 611
  21. at App::module() in App.php line 456
  22. at App::exec() in App.php line 139
  23. at App::run() in start.php line 19
  24. at require('/home/www/wwwroot/fi...') in index.php line 40

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.gdtrbxg.com
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
PATH_INFO
/play/20240514/2814pax/712491.html
REDIRECT_STATUS
200
SERVER_NAME
film.com
SERVER_PORT
80
SERVER_ADDR
172.247.114.184
REMOTE_PORT
20002
REMOTE_ADDR
156.224.36.123
SERVER_SOFTWARE
nginx/1.24.0
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/home/www/wwwroot/film.com
DOCUMENT_URI
/index.php
REQUEST_URI
/play/20240514/2814pax/712491.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/play/20240514/2814pax/712491.html
SCRIPT_FILENAME
/home/www/wwwroot/film.com/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1717056556.5215
REQUEST_TIME
1717056556
HTTP_REFERER
no_referer
Environment Variables
empty

ThinkPHP Constants

ROOT_PATH
/home/www/wwwroot/film.com/
APP_PATH
/home/www/wwwroot/film.com/application/
MAC_COMM
/home/www/wwwroot/film.com/application/common/common/
MAC_HOME_COMM
/home/www/wwwroot/film.com/application/index/common/
MAC_ADMIN_COMM
/home/www/wwwroot/film.com/application/admin/common/
MAC_START_TIME
1717056556.5255
BIND_MODULE
index
ENTRANCE
index
IN_FILE
/index.php
THINK_VERSION
5.0.24
THINK_START_TIME
1717056556.5257
THINK_START_MEM
974424
EXT
.php
DS
/
THINK_PATH
/home/www/wwwroot/film.com/thinkphp/
LIB_PATH
/home/www/wwwroot/film.com/thinkphp/library/
CORE_PATH
/home/www/wwwroot/film.com/thinkphp/library/think/
TRAIT_PATH
/home/www/wwwroot/film.com/thinkphp/library/traits/
EXTEND_PATH
/home/www/wwwroot/film.com/extend/
VENDOR_PATH
/home/www/wwwroot/film.com/vendor/
RUNTIME_PATH
/home/www/wwwroot/film.com/runtime/
LOG_PATH
/home/www/wwwroot/film.com/runtime/log/
CACHE_PATH
/home/www/wwwroot/film.com/runtime/cache/
TEMP_PATH
/home/www/wwwroot/film.com/runtime/temp/
CONF_PATH
/home/www/wwwroot/film.com/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
ADDON_PATH
/home/www/wwwroot/film.com/addons/
MAC_URL
http://www.maccms.la/
MAC_NAME
苹果CMS
MAC_PATH
/
MAC_MOB
0
MAC_ROOT_TEMPLATE
/home/www/wwwroot/film.com/template/default10/html/
MAC_PATH_TEMPLATE
/template/default10/
MAC_PATH_TPL
/template/default10/html/
MAC_PATH_ADS
/template/default10/ads/
MAC_PAGE_SP
_
MAC_PLAYER_SORT
1
MAC_ADDON_PATH
/home/www/wwwroot/film.com/addons/
MAC_ADDON_PATH_STATIC
/home/www/wwwroot/film.com/static/addons/
ROOT
/home/www/wwwroot/film.com/seo