[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...', 'root', '1qaz1234', [0, 2, 0, ...]) in Connection.php line 528
  3. at Connection->connect() in Connection.php line 2026
  4. at Connection->initConnect(false) in Connection.php line 644
  5. at Connection->query('SHOW COLUMNS FROM `g...', [], false, true) in Mysql.php line 90
  6. at Mysql->getFields('`goods_down`') in Connection.php line 377
  7. at Connection->getTableInfo('goods_down', 'pk') in Connection.php line 414
  8. at Connection->getPk('goods_down') in Query.php line 2454
  9. at Query->getPk(['table' => 'goods_down', 'field' => ['*', 'goods_thumbnail_url ...', 'coupon_discount as c...'], 'where' => ['AND' => [['goods_id', '=', 'Y9T2omrCJC9PCnrhwfDZ...']]], ...]) in Connection.php line 793
  10. at Connection->find(object(Query)) in Query.php line 3132
  11. at Query->find() in Goodsdetail.php line 46
  12. at Goodsdetail->index()
  13. at ReflectionMethod->invokeArgs(object(Goodsdetail), []) in Container.php line 395
  14. at Container->invokeReflectMethod(object(Goodsdetail), object(ReflectionMethod), ['goodsid' => 'Y9T2omrCJC9PCnrhwfDZ...']) in Module.php line 132
  15. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  16. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  17. at Middleware->think\{closure}(object(Request))
  18. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  19. at Middleware->dispatch(object(Request), 'controller') in Module.php line 137
  20. at Module->exec() in Dispatch.php line 168
  21. at Dispatch->run() in App.php line 432
  22. at App->think\{closure}(object(Request), object(Closure), null)
  23. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  24. at Middleware->think\{closure}(object(Request))
  25. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  26. at Middleware->dispatch(object(Request)) in App.php line 435
  27. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
UNIQUE_ID ZgaB2MV9jdJhYeEZ017UTAAAADQ
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
HTTP_HOST 90jo.com
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
SERVER_SIGNATURE
SERVER_SOFTWARE Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.24
SERVER_NAME 90jo.com
SERVER_ADDR 172.18.55.158
SERVER_PORT 80
REMOTE_ADDR 54.81.136.84
DOCUMENT_ROOT /var/www/html/wx/public/
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /var/www/html/wx/public/
SERVER_ADMIN root@localhost
SCRIPT_FILENAME /var/www/html/wx/public/index.php
REMOTE_PORT 56810
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /index.php/index/goodsdetail/index/goodsid/Y9T2omrCJC9PCnrhwfDZA9MxGST4_Uah_JQFmkQxeAO
SCRIPT_NAME /index.php
PATH_INFO /index/goodsdetail/index/goodsid/Y9T2omrCJC9PCnrhwfDZA9MxGST4_Uah_JQFmkQxeAO
PATH_TRANSLATED /var/www/html/wx/public/index/goodsdetail/index/goodsid/Y9T2omrCJC9PCnrhwfDZA9MxGST4_Uah_JQFmkQxeAO
PHP_SELF /index.php/index/goodsdetail/index/goodsid/Y9T2omrCJC9PCnrhwfDZA9MxGST4_Uah_JQFmkQxeAO
REQUEST_TIME_FLOAT 1711702488.732
REQUEST_TIME 1711702488
Environment Variablesempty
ThinkPHP Constants
QINIU_FUNCTIONS_VERSION 7.2.9