[2002] PDOException in Connection.php line 295

SQLSTATE[HY000] [2002] Connection refused

  1. $this->fetchType = $config['result_type'];
  2. }
  3. try {
  4. if (empty($config['dsn'])) {
  5. $config['dsn'] = $this->parseDsn($config);
  6. }
  7. if ($config['debug']) {
  8. $startTime = microtime(true);
  9. }
  10. $this->links[$linkNum] = new PDO($config['dsn'], $config['username'], $config['password'], $params);
  11. if ($config['debug']) {
  12. // 记录数据库连接信息
  13. Log::record('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn'], 'sql');
  14. }
  15. } catch (\PDOException $e) {
  16. if ($autoConnection) {
  17. Log::record($e->getMessage(), 'error');
  18. return $this->connect($autoConnection, $linkNum);
  19. } else {

Call Stack

  1. in Connection.php line 295
  2. at PDO->__construct('mysql:host=localhost...', 'axmhj_qf', 'WnLFtHu7PX', [0, 2, 0, ...]) in Connection.php line 295
  3. at Connection->connect() in Connection.php line 995
  4. at Connection->initConnect(false) in Connection.php line 348
  5. at Connection->query('SHOW COLUMNS FROM `q...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('`qf_goods`') in Query.php line 1921
  7. at Query->getTableInfo('qf_goods', 'pk') in Query.php line 1955
  8. at Query->getPk(['multi' => ['AND' => ['id' => [['eq', 12]]]], 'where' => ['AND' => ['id' => ['eq', 12]]], 'field' => ['*'], ...]) in Query.php line 2639
  9. at Query->find() in IndexBase.php line 1
  10. at IndexBase->getInfo(['id' => ['eq', 12]], '*') in IndexBase.php line 3
  11. at IndexBase->getInfoById(12, '*') in Goods.php line 3
  12. at Goods->getGoodsInfo(12, '*') in Goods.php line 3
  13. at Goods->goodsInfo(12) in Goods.php line 2
  14. at Goods->info()
  15. at ReflectionMethod->invokeArgs(object(Goods), []) in App.php line 343
  16. at App::invokeMethod([object(Goods), 'info'], []) in App.php line 611
  17. at App::module(['index', 'goods', 'info'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  18. at App::exec(['type' => 'module', 'module' => ['index', 'goods', 'info'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  19. at App::run() in start.php line 19
  20. at require('/home/axmhj/domains/...') in index.php line 18

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

REDIRECT_UNIQUE_ID
YzQ4l93PVDRxNh4I2D9vTAAAAGY
REDIRECT_icp_url
https://beian.miit.gov.cn/#/Integrated/index
REDIRECT_gongan_url
http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=
REDIRECT_STATUS
200
UNIQUE_ID
YzQ4l93PVDRxNh4I2D9vTAAAAGY
icp_url
https://beian.miit.gov.cn/#/Integrated/index
gongan_url
http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=
HTTP_HOST
www.central-pharm.com
HTTP_USER_AGENT
Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)
HTTP_ACCEPT
*/*
HTTP_REFERER
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache/2
SERVER_NAME
www.central-pharm.com
SERVER_ADDR
192.168.64.8
SERVER_PORT
80
REMOTE_ADDR
103.54.60.66
DOCUMENT_ROOT
/home/axmhj/domains/central-pharm.com/public_html/public
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/home/axmhj/domains/central-pharm.com/public_html/public
SERVER_ADMIN
webmaster@central-pharm.com
SCRIPT_FILENAME
/home/axmhj/domains/central-pharm.com/public_html/public/index.php
REMOTE_PORT
49522
REDIRECT_URL
/proinfo/12.html
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
REQUEST_METHOD
GET
QUERY_STRING
REQUEST_URI
/proinfo/12.html
SCRIPT_NAME
/index.php
PATH_INFO
/proinfo/12.html
PATH_TRANSLATED
redirect:/index.php/proinfo/12.html/12.html
PHP_SELF
/index.php/proinfo/12.html
REQUEST_TIME_FLOAT
1664366743.998
REQUEST_TIME
1664366743
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/home/axmhj/domains/central-pharm.com/public_html/public/../zmcapps/
THINK_VERSION
5.0.24
THINK_START_TIME
1664366744.0187
THINK_START_MEM
408296
EXT
.php
DS
/
THINK_PATH
/home/axmhj/domains/central-pharm.com/public_html/thinkphp/
LIB_PATH
/home/axmhj/domains/central-pharm.com/public_html/thinkphp/library/
CORE_PATH
/home/axmhj/domains/central-pharm.com/public_html/thinkphp/library/think/
TRAIT_PATH
/home/axmhj/domains/central-pharm.com/public_html/thinkphp/library/traits/
ROOT_PATH
/home/axmhj/domains/central-pharm.com/public_html/
EXTEND_PATH
/home/axmhj/domains/central-pharm.com/public_html/extend/
VENDOR_PATH
/home/axmhj/domains/central-pharm.com/public_html/vendor/
RUNTIME_PATH
/home/axmhj/domains/central-pharm.com/public_html/runtime/
LOG_PATH
/home/axmhj/domains/central-pharm.com/public_html/runtime/log/
CACHE_PATH
/home/axmhj/domains/central-pharm.com/public_html/runtime/cache/
TEMP_PATH
/home/axmhj/domains/central-pharm.com/public_html/runtime/temp/
CONF_PATH
/home/axmhj/domains/central-pharm.com/public_html/public/../zmcapps/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
ADDON_PATH
/home/axmhj/domains/central-pharm.com/public_html/addons/