[2002] PDOException in Connection.phphtml line 477

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. } catch (\PDOException $e) {
  14. if ($autoConnection) {
  15. $this->log($e->getMessage(), 'error');
  16. return $this->connect($autoConnection, $linkNum);

Call Stack

  1. in Connection.phphtml line 477
  2. at PDO->__construct('mysql:dbname=glxyh;h...', 'glxyh', 'F7krJhCFFYwxnmkh', [0, 2, 0, ...]) in Connection.phphtml line 477
  3. at Connection->connect() in Connection.phphtml line 1894
  4. at Connection->initConnect(false) in Connection.phphtml line 600
  5. at Connection->query('SHOW COLUMNS FROM `x...', [], false, true) in Mysql.phphtml line 88
  6. at Mysql->getFields('xyh_views') in Connection.phphtml line 356
  7. at Connection->getTableInfo('xyh_views', 'bind') in Connection.phphtml line 410
  8. at Connection->getFieldsBind('xyh_views') in Builder.phphtml line 267
  9. at Builder->buildWhere(object(Query), ['AND' => ['viewip' => ['viewip', 'eq', '156.234.115.48']]]) in Builder.phphtml line 238
  10. at Builder->parseWhere(object(Query), ['AND' => ['viewip' => ['viewip', 'eq', '156.234.115.48']]]) in Builder.phphtml line 762
  11. at Builder->select(object(Query)) in Connection.phphtml line 785
  12. at Connection->find(object(Query)) in Query.phphtml line 2294
  13. at Query->find() in BaseController.phphtml line 23
  14. at BaseController->initialize() in IndexController.phphtml line 22
  15. at IndexController->initialize() in Controller.phphtml line 64
  16. at Controller->__construct(object(Request), object(App))
  17. at ReflectionClass->newInstanceArgs([object(Request), object(App)]) in Container.phphtml line 225
  18. at Container->invokeClass('app\home\controller\...', []) in Container.phphtml line 141
  19. at Container->make('app\home\controller\...') in App.phphtml line 759
  20. at App->__get('app\home\controller\...') in App.phphtml line 480
  21. at App->controller('index', 'controller', true, 'Error') in Module.phphtml line 100
  22. at Module->run() in Url.phphtml line 26
  23. at Url->run() in App.phphtml line 309
  24. at App->run() in start.phphtml line 21
  25. at require('/home/wwwroot/www.gl...') in index.phphtml line 22

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
FCGI_ROLE RESPONDER
proxy-nokeepalive 1
HTTP_HOST www.ghaintgeet.com
HTTP_ACCEPT */*
HTTP_USER_AGENT Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH /www/server/apache/lib
SERVER_SIGNATURE <address>Apache Server at www.ghaintgeet.com Port 80</address>
SERVER_SOFTWARE Apache
SERVER_NAME www.ghaintgeet.com
SERVER_ADDR 211.149.143.121
SERVER_PORT 80
REMOTE_ADDR 156.234.115.48
DOCUMENT_ROOT /www/wwwroot/www.glxyh.net/public
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /www/wwwroot/www.glxyh.net/public
SERVER_ADMIN webmaster@example.com
SCRIPT_FILENAME /www/wwwroot/www.glxyh.net/public/index.phphtml
REMOTE_PORT 48811
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /
SCRIPT_NAME /index.phphtml
PHP_SELF /index.phphtml
REQUEST_TIME_FLOAT 1623659574.0679
REQUEST_TIME 1623659574
Environment Variablesempty
ThinkPHP Constants
APP_PATH /home/wwwroot/www.glxyh.net/public/../application/
APP_NAME APP
APP_DEBUG true
ThinkPHP V5.1.0RC1 { 十年磨一剑-为API开发设计的高性能框架 }
威廉希尔体育网页版登陆必威安卓猫先生cat