[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...', 'lzdbus_t', 'H21Grbpg9a@h0#OnFeYj...', [0, 2, 0, ...]) in Connection.php line 528
  3. at Connection->connect() in Connection.php line 2022
  4. at Connection->initConnect(false) in Connection.php line 644
  5. at Connection->query('SHOW COLUMNS FROM `e...', [], false, true) in Mysql.php line 90
  6. at Mysql->getFields('`e_system_config`') in Connection.php line 377
  7. at Connection->getTableInfo('e_system_config', 'bind') in Connection.php line 454
  8. at Connection->getFieldsBind('e_system_config') in Builder.php line 292
  9. at Builder->buildWhere(object(Query), ['AND' => [['id', '=', 1]]]) in Builder.php line 264
  10. at Builder->parseWhere(object(Query), ['AND' => [['id', '=', 1]]]) in Builder.php line 991
  11. at Builder->select(object(Query)) in Connection.php line 1277
  12. at Connection->value(object(Query), ['area_on'], null) in Query.php line 594
  13. at Query->value('area_on') in Action.php line 21
  14. at Action->setConfig(655) in TourIndex.php line 20
  15. at TourIndex->index('index', 655, 0)
  16. at ReflectionMethod->invokeArgs(object(TourIndex), ['index', 0, 0]) in Container.php line 395
  17. at Container->invokeReflectMethod(object(TourIndex), object(ReflectionMethod), ['convert' => false]) in Module.php line 132
  18. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  19. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  20. at Middleware->think\{closure}(object(Request))
  21. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  22. at Middleware->dispatch(object(Request), 'controller') in Module.php line 137
  23. at Module->exec() in Dispatch.php line 168
  24. at Dispatch->run() in App.php line 432
  25. at App->think\{closure}(object(Request), object(Closure), null)
  26. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  27. at Middleware->think\{closure}(object(Request))
  28. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  29. at Middleware->dispatch(object(Request)) in App.php line 435
  30. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_X_FORWARDED_FOR 59.69.99.200
HTTP_CLIENT_IP 218.227.231.223
HTTP_REFERER http://tour.h2ecig.com/
HTTP_ACCEPT_ENCODING gzip,deflate
HTTP_ACCEPT */*
HTTP_USER_AGENT Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)
HTTP_HOST tour.h2ecig.com
REDIRECT_STATUS 200
SERVER_NAME t.h2ecig.com
SERVER_PORT 80
SERVER_ADDR 191.168.0.3
REMOTE_PORT 64988
REMOTE_ADDR 23.83.37.145
SERVER_SOFTWARE nginx/1.12.1
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /alidata/www/t.h2ecig.com/public
DOCUMENT_URI /index.php
REQUEST_URI /
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /alidata/www/t.h2ecig.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1558634613.0182
REQUEST_TIME 1558634613
Environment Variablesempty
ThinkPHP Constantsempty