[2002] PDOException in Connection.php line 293

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 293
  2. at PDO->__construct('mysql:host=127.0.0.1...', 'sjgjmysc_com', 'pFpDdsWHxtpe4rAT', [0, 2, 0, ...]) in Connection.php line 293
  3. at Connection->connect() in Connection.php line 998
  4. at Connection->initConnect(false) in Connection.php line 347
  5. at Connection->query('SHOW COLUMNS FROM `t...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('tp_config') in Query.php line 1749
  7. at Query->getTableInfo('tp_config', 'type') in Query.php line 1797
  8. at Query->getFieldsType('tp_config') in Query.php line 1803
  9. at Query->getFieldsBind('tp_config') in Builder.php line 263
  10. at Builder->buildWhere([], ['table' => 'tp_config', 'where' => [], 'field' => '*', ...]) in Builder.php line 233
  11. at Builder->parseWhere([], ['table' => 'tp_config', 'where' => [], 'field' => '*', ...]) in Builder.php line 697
  12. at Builder->select(['table' => 'tp_config', 'where' => [], 'field' => '*', ...]) in Query.php line 2332
  13. at Query->select() in Base.php line 51
  14. at Base->public_assign() in Base.php line 43
  15. at Base->_initialize() in Controller.php line 85
  16. at Controller->__construct(object(Request))
  17. at ReflectionClass->newInstanceArgs([object(Request)]) in App.php line 362
  18. at App::invokeClass('app\home\controller\...') in Loader.php line 459
  19. at Loader::controller('Goods', 'controller', false, 'Error') in App.php line 580
  20. at App::module(['Home', 'Goods', 'goodsList'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 460
  21. at App::exec(['type' => 'module', 'module' => ['Home', 'Goods', 'goodsList']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 142
  22. at App::run() in start.php line 19
  23. at require('/www/wwwroot/sjgjmys...') in index.php line 60

Environment Variables

GET Data

id
162
POST Data
empty
Files
empty

Cookies

is_mobile
0
Session
empty

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/www/wwwroot/sjgjmysc.com/index.php
QUERY_STRING
s=/Home/Goods/goodsList/id/162.html
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/Home/Goods/goodsList/id/162.html
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/www/wwwroot/sjgjmysc.com
SERVER_PROTOCOL
HTTP/1.1
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.18.0
REMOTE_ADDR
44.203.219.117
REMOTE_PORT
60786
SERVER_ADDR
10.0.16.7
SERVER_PORT
80
SERVER_NAME
sjgjmysc.com
REDIRECT_STATUS
200
PATH_INFO
/Home/Goods/goodsList/id/162.html
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_HOST
sjgjmysc.com
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711644994.8522
REQUEST_TIME
1711644994
Environment Variables
empty

ThinkPHP Constants

PLUGIN_PATH
/www/wwwroot/sjgjmysc.com/plugins/
UPLOAD_PATH
public/upload/
TPSHOP_CACHE_TIME
31104000
SITE_URL
http://sjgjmysc.com
HTTP
http
INSTALL_DATE
1463741583
SERIALNUMBER
20160520065303oCWIoa
APP_PATH
/www/wwwroot/sjgjmysc.com/application/
NOW_TIME
1711644994
THINK_VERSION
5.0.15
THINK_START_TIME
1711644994.8527
THINK_START_MEM
275784
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/sjgjmysc.com/thinkphp/
LIB_PATH
/www/wwwroot/sjgjmysc.com/thinkphp/library/
CORE_PATH
/www/wwwroot/sjgjmysc.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/sjgjmysc.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/sjgjmysc.com/
EXTEND_PATH
/www/wwwroot/sjgjmysc.com/extend/
VENDOR_PATH
/www/wwwroot/sjgjmysc.com/vendor/
RUNTIME_PATH
/www/wwwroot/sjgjmysc.com/runtime/
LOG_PATH
/www/wwwroot/sjgjmysc.com/runtime/log/
CACHE_PATH
/www/wwwroot/sjgjmysc.com/runtime/cache/
TEMP_PATH
/www/wwwroot/sjgjmysc.com/runtime/temp/
CONF_PATH
/www/wwwroot/sjgjmysc.com/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
ADDON_PATH
/www/wwwroot/sjgjmysc.com/addons/
EXTEND_MODULE
1
EXTEND_ANDROID
2
EXTEND_IOS
3
EXTEND_ENTRUST
4
EXTEND_MINIAPP
5
EXTEND_H5
6
TIME_MOUTH
4
IS_AJAX
false
IS_GET
true
IS_POST
false
MODULE_NAME
home
CONTROLLER_NAME
Goods
ACTION_NAME
goodsList
PREFIX
tp_
SESSION_ID