[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('mysql:host=127.0.0.1...', 'youming', 'ERbFy4YenmX8ajSA', [2, true, 2, ...]) in Connection.php line 528
  3. at Connection->connect() in Connection.php line 2024
  4. at Connection->initConnect(false) in Connection.php line 644
  5. at Connection->query('SHOW COLUMNS FROM `s...', [], false, true) in Mysql.php line 90
  6. at Mysql->getFields('`s_trade_contact`') in Connection.php line 377
  7. at Connection->getTableInfo('s_trade_contact', 'bind') in Connection.php line 454
  8. at Connection->getFieldsBind('s_trade_contact') in Builder.php line 292
  9. at Builder->buildWhere(object(Query), ['AND' => [['foot', '=', 1]]]) in Builder.php line 264
  10. at Builder->parseWhere(object(Query), ['AND' => [['foot', '=', 1]]]) in Builder.php line 998
  11. at Builder->select(object(Query)) in Connection.php line 908
  12. at Connection->select(object(Query)) in Query.php line 3028
  13. at Query->select() in Login.php line 29
  14. at Login->index()
  15. at ReflectionMethod->invokeArgs(object(Login), []) in Container.php line 395
  16. at Container->invokeReflectMethod(object(Login), object(ReflectionMethod), ['formurl' => 'copyright/Index/sell...', 'convert' => false]) in Module.php line 131
  17. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  18. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  19. at Middleware->think\{closure}(object(Request))
  20. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  21. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  22. at Module->exec() in Dispatch.php line 168
  23. at Dispatch->run() in App.php line 432
  24. at App->think\{closure}(object(Request), object(Closure), null)
  25. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  26. at Middleware->think\{closure}(object(Request)) in SystemEnvCheck.php line 66
  27. at SystemEnvCheck->handle(object(Request), object(Closure), null)
  28. at call_user_func_array([object(SystemEnvCheck), 'handle'], [object(Request), object(Closure), null]) in Middleware.php line 185
  29. at Middleware->think\{closure}(object(Request))
  30. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  31. at Middleware->dispatch(object(Request)) in App.php line 435
  32. at App->run() in index.php line 90

Environment Variables

GET Data
formurl copyright/Index/sellcopyright
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_REFERER http://longyan.youming.com/user/login.html?formurl=copyright/Index/sellcopyright
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST longyan.youming.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.youming.com
SERVER_PORT 443
SERVER_ADDR 172.19.106.102
REMOTE_PORT 53792
REMOTE_ADDR 3.93.59.171
SERVER_SOFTWARE nginx/1.21.4
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/www.youming.com/public
DOCUMENT_URI /index.php
REQUEST_URI /user/login.html?formurl=copyright/Index/sellcopyright
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/user/login.html&formurl=copyright/Index/sellcopyright
SCRIPT_FILENAME /www/wwwroot/www.youming.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711654184.9032
REQUEST_TIME 1711654184
Environment Variablesempty
ThinkPHP Constants
QINIU_FUNCTIONS_VERSION 7.3.0
APPLICATION_VERSION v1.4.0
DS /
__MY_HTTP__ https
__MY_ROOT__
__MY_ROOT_PUBLIC__ /
__MY_HOST__ longyan.youming.com
__MY_URL__ https://longyan.youming.com/
__MY_PUBLIC_URL__ https://longyan.youming.com/
__MY_VIEW_URL__ https://longyan.youming.com/user/login.html?formurl=copyright/Index/sellcopyright
ROOT_PATH /www/wwwroot/www.youming.com/public/
ROOT /www/wwwroot/www.youming.com/
APP_PATH /www/wwwroot/www.youming.com/application/
VENFOR_PATH /www/wwwroot/www.youming.com/vendor/
APPLICATION web
APPLICATION_CLIENT default
APPLICATION_CLIENT_TYPE pc
IS_AJAX false
BIND_MODULE trade
BIND_ACTION index