[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() in Connection.php line 528
  3. at Connection->connect() in Connection.php line 2024
  4. at Connection->initConnect() in Connection.php line 644
  5. at Connection->query() in Mysql.php line 90
  6. at Mysql->getFields() in Connection.php line 377
  7. at Connection->getTableInfo() in Connection.php line 414
  8. at Connection->getPk() in Query.php line 2474
  9. at Query->getPk() in Connection.php line 793
  10. at Connection->find() in Query.php line 3152
  11. at Query->find() in ArticleModule.php line 65
  12. at ArticleModule->show()
  13. at ReflectionMethod->invokeArgs() in Container.php line 395
  14. at Container->invokeReflectMethod() in Module.php line 131
  15. at Module->think\route\dispatch\{closure}()
  16. at call_user_func_array() in Middleware.php line 185
  17. at Middleware->think\{closure}()
  18. at call_user_func() in Middleware.php line 130
  19. at Middleware->dispatch() in Module.php line 136
  20. at Module->exec() in Dispatch.php line 168
  21. at Dispatch->run() in App.php line 432
  22. at App->think\{closure}()
  23. at call_user_func_array() in Middleware.php line 185
  24. at Middleware->think\{closure}()
  25. at call_user_func() in Middleware.php line 130
  26. at Middleware->dispatch() in App.php line 435
  27. at App->run() in index.php line 36

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_REFERER
HTTP_ACCEPT */*
HTTP_USER_AGENT Baiduspider+(+http://www.baidu.com/search/spider.htm")
HTTP_HOST www.videochaterotico.net
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.videochaterotico.net
SERVER_PORT 80
SERVER_ADDR 10.0.12.12
REMOTE_PORT 47566
REMOTE_ADDR 43.230.168.250
SERVER_SOFTWARE nginx/1.22.1
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/www.videochaterotico.net
DOCUMENT_URI /index.php
REQUEST_URI /news/77-2733.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/news/77-2733.html
SCRIPT_FILENAME /www/wwwroot/www.videochaterotico.net/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1715863622.1972
REQUEST_TIME 1715863622
Environment Variablesempty
ThinkPHP Constantsempty