[2002] PDOException in Connection.php line 526

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 526
  2. at PDO->__construct('mysql:host=127.0.0.1...', 'web_coolthink_cn', 'coolthink!=20180111', [0, 2, 0, ...]) in Connection.php line 526
  3. at Connection->connect() in Connection.php line 2015
  4. at Connection->initConnect(false) in Connection.php line 649
  5. at Connection->query('SHOW COLUMNS FROM `m...', [], false, true) in Mysql.php line 90
  6. at Mysql->getFields('module') in Connection.php line 375
  7. at Connection->getTableInfo('module', 'bind') in Connection.php line 452
  8. at Connection->getFieldsBind('module') in Builder.php line 294
  9. at Builder->buildWhere(object(Query), ['AND' => ['id' => ['id', '=', 1]]]) in Builder.php line 266
  10. at Builder->parseWhere(object(Query), ['AND' => ['id' => ['id', '=', 1]]]) in Builder.php line 1048
  11. at Builder->select(object(Query)) in Connection.php line 847
  12. at Connection->find(object(Query)) in Query.php line 2879
  13. at Query->find(1)
  14. at call_user_func_array([object(Query), 'find'], [1]) in Model.php line 1131
  15. at Model->__call('find', [1]) in Base.php line 37
  16. at Module->find(1) in Base.php line 37
  17. at Base->initialize() in Index.php line 21
  18. at Index->initialize() in Controller.php line 68
  19. at Controller->__construct(object(App))
  20. at ReflectionClass->newInstanceArgs([object(App)]) in Container.php line 416
  21. at Container->invokeClass('app\index\controller...', []) in Container.php line 261
  22. at Container->make('app\index\controller...') in Container.php line 490
  23. at Container->__get('app\index\controller...') in App.php line 715
  24. at App->controller('index', 'controller', false, 'index') in Module.php line 99
  25. at Module->exec() in Dispatch.php line 167
  26. at Dispatch->run() in App.php line 432
  27. at App->think\{closure}(object(Request), object(Closure), null)
  28. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 176
  29. at Middleware->think\{closure}(object(Request))
  30. at call_user_func(object(Closure), object(Request)) in Middleware.php line 121
  31. at Middleware->dispatch(object(Request)) in App.php line 435
  32. 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
FCGI_ROLE RESPONDER
SCRIPT_FILENAME /data/web/ccz.yichun.com/public/index.php
QUERY_STRING s=/index/index/about4.html
REQUEST_METHOD GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME /index.php
REQUEST_URI /index/index/about4.html
DOCUMENT_URI /index.php
DOCUMENT_ROOT /data/web/ccz.yichun.com/public
SERVER_PROTOCOL HTTP/1.1
REQUEST_SCHEME http
GATEWAY_INTERFACE CGI/1.1
SERVER_SOFTWARE nginx/1.10.3
REMOTE_ADDR 18.233.223.189
REMOTE_PORT 54338
SERVER_ADDR 10.9.137.147
SERVER_PORT 80
SERVER_NAME www.coolthink.net
REDIRECT_STATUS 200
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
HTTP_HOST coolthink.cn
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711647897.4949
REQUEST_TIME 1711647897
Environment Variablesempty
ThinkPHP Constants
url /index/index/about4.html
ref
ent claudebot
site http://sgj.fre09.com/
road ?road=coolthink.cn/index/index/about4.html
memes ?road=coolthink.cn/index/index/about4.html&referer=
regs @BaiduSpider|Sogou|Yisou|Haosou|360Spider@i
mobile /phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/
area false
WEB_PATH /data/web/ccz.yichun.com/