[2002] PDOException in Connection.php line 528

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

  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 528
  2. at PDO->__construct('mysql:host=rm-bp102h...', 'tongyiling_mysql', 'mn@!ZXCV_$asdf1234__...', [0, 2, 0, ...]) in Connection.php line 528
  3. at Connection->connect() in Connection.php line 2024
  4. at Connection->initConnect(false) in Connection.php line 644
  5. at Connection->query('SHOW COLUMNS FROM `s...', [], false, true) in Mysql.php line 90
  6. at Mysql->getFields('`stb_WxConfig`') in Connection.php line 377
  7. at Connection->getTableInfo('stb_WxConfig', 'pk') in Connection.php line 414
  8. at Connection->getPk('stb_WxConfig') in Query.php line 2474
  9. at Query->getPk(['table' => 'stb_WxConfig', 'where' => ['AND' => [['app_id', '=', 'wxd7aa44d926c9a805']]], 'cache' => ['key' => true, 'expire' => null, 'tag' => null], ...]) in Connection.php line 793
  10. at Connection->find(object(Query)) in Query.php line 3152
  11. at Query->find() in common.php line 730
  12. at get_url_agent('wechat') in Home.php line 27
  13. at Home->initialize() in Controller.php line 68
  14. at Controller->__construct(object(App))
  15. at ReflectionClass->newInstanceArgs([object(App)]) in Container.php line 439
  16. at Container->invokeClass('app\cdms\home\Home', []) in Container.php line 284
  17. at Container->make('app\cdms\home\Home', []) in App.php line 725
  18. at App->controller('home', 'home', false, 'Error') in Module.php line 94
  19. at Module->exec() in Dispatch.php line 168
  20. at Dispatch->run() in App.php line 432
  21. at App->think\{closure}(object(Request), object(Closure), null)
  22. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  23. at Middleware->think\{closure}(object(Request))
  24. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  25. at Middleware->dispatch(object(Request)) in App.php line 435
  26. at App->run() in index.php line 35

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST wxd7aa44d926c9a805.novel.tongyiling.xiaoshuoshangcheng.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME novel.tongyiling.xiaoshuoshangcheng.com
SERVER_PORT 80
SERVER_ADDR 172.24.146.158
REMOTE_PORT 58412
REMOTE_ADDR 34.238.138.162
SERVER_SOFTWARE nginx/1.20.2
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /test/wwwroot/tongyiling/novel/public
DOCUMENT_URI /index.php
REQUEST_URI /books/id/7d1eoPLt4FwdBTzB_9SkHA1bHPtjLSLM-l2dajaM_nVf
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/books/id/7d1eoPLt4FwdBTzB_9SkHA1bHPtjLSLM-l2dajaM_nVf
SCRIPT_FILENAME /test/wwwroot/tongyiling/novel/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711627863.3324
REQUEST_TIME 1711627863
Environment Variablesempty
ThinkPHP Constants
ADMIN_FILE admin.php
HTMLPURIFIER_PREFIX /test/wwwroot/tongyiling/novel/vendor/ezyang/htmlpurifier/library
ENCODE_KEY a!takA:dlmcldEv,e
URL_REPLACE {#url}
URL_ROOT_AGENT /
PUBLIC_PATH /