[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...', 'root', 'Cjs922815', [0, 2, 0, ...]) in Connection.php line 526
  3. at Connection->connect() in Connection.php line 2018
  4. at Connection->initConnect(false) in Connection.php line 649
  5. at Connection->query('SHOW COLUMNS FROM `b...', [], false, true) in Mysql.php line 90
  6. at Mysql->getFields('`bms_website`') in Connection.php line 375
  7. at Connection->getTableInfo('bms_website', 'pk') in Connection.php line 412
  8. at Connection->getPk('bms_website') in Query.php line 2280
  9. at Query->getPk(['where' => ['AND' => [['site_host|site_host2', '=', 'www.qdswwl.com']]], 'table' => 'bms_website', 'field' => '*', ...]) in Connection.php line 812
  10. at Connection->find(object(Query)) in Query.php line 2851
  11. at Query->find() in Index.php line 248
  12. at Index->fzindex()
  13. at ReflectionMethod->invokeArgs(object(Index), []) in Container.php line 355
  14. at Container->invokeReflectMethod(object(Index), object(ReflectionMethod), ['m' => 'pc', 'bs' => 'kehu', 'yuming' => 'qdswwl.com', ...]) in Module.php line 133
  15. at Module->exec() in Dispatch.php line 165
  16. at Dispatch->run() in App.php line 433
  17. at App->think\{closure}(object(Request), object(Closure), null)
  18. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 142
  19. at Middleware->think\{closure}(object(Request))
  20. at call_user_func(object(Closure), object(Request)) in Middleware.php line 94
  21. at Middleware->dispatch(object(Request)) in App.php line 456
  22. at App->run() in index.php line 21

Environment Variables

GET Data
m pc
bs kehu
yuming qdswwl.com
qianzhui ujs
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
SCRIPT_NAME /index.php
REQUEST_URI /home/Index/fzindex?m=pc&bs=kehu&yuming=qdswwl.com&qianzhui=ujs
QUERY_STRING m=pc&bs=kehu&yuming=qdswwl.com&qianzhui=ujs
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_QUERY_STRING m=pc&bs=kehu&yuming=qdswwl.com&qianzhui=ujs
REDIRECT_URL /home/Index/fzindex
REMOTE_PORT 65043
SCRIPT_FILENAME /www/wwwroot/bms/index.php
SERVER_ADMIN webmaster@example.com
CONTEXT_DOCUMENT_ROOT /www/wwwroot/bms
CONTEXT_PREFIX
REQUEST_SCHEME http
DOCUMENT_ROOT /www/wwwroot/bms
REMOTE_ADDR 124.156.177.141
SERVER_PORT 80
SERVER_ADDR 172.31.244.42
SERVER_NAME 47.244.221.39
SERVER_SOFTWARE Apache
SERVER_SIGNATURE <address>Apache Server at 47.244.221.39 Port 80</address>
LD_LIBRARY_PATH /www/server/apache/lib
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_REFERER _REFERER_
HTTP_ACCEPT */*
HTTP_HOST 47.244.221.39
HTTP_USER_AGENT _USERAGENT_
proxy-nokeepalive 1
REDIRECT_STATUS 200
REDIRECT_PATH_INFO home/Index/fzindex
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1582407330.7992
REQUEST_TIME 1582407330
Environment Variablesempty
ThinkPHP Constants
APP_PATH /www/wwwroot/bms/app/
QINIU_FUNCTIONS_VERSION 7.2.3
__ROOT__
0.042840s