[2002] PDOException in Connection.php line 528

SQLSTATE[HY000] [2002] No such file or directory

  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=localhost...', 'root', '28cf8e7c29e11034', [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 `t...', [], false, true) in Mysql.php line 90
  6. at Mysql->getFields('`tp_cate`') in Connection.php line 377
  7. at Connection->getTableInfo('tp_cate', 'bind') in Connection.php line 454
  8. at Connection->getFieldsBind('tp_cate') in Builder.php line 292
  9. at Builder->buildWhere(object(Query), []) in Builder.php line 264
  10. at Builder->parseWhere(object(Query), []) in Builder.php line 998
  11. at Builder->select(object(Query)) in Connection.php line 908
  12. at Connection->select(object(Query)) in Query.php line 3028
  13. at Query->select() in route.php line 34
  14. at include('/www/wwwroot/uidir.c...') in App.php line 554
  15. at App->routeInit() in App.php line 259
  16. at App->initialize() in App.php line 379
  17. at App->run() in index.php line 19

Environment Variables

GET Data
s /news-8.html
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_CONNECTION keep-alive
HTTP_VIA 1.1 PSmgbsdBOS1dc75:14 (W), 1.1 PSxgHK4ho170:2 (W)
HTTP_X_INITIAL_URL https://www.uidir.com/news-8.html
HTTP_X_WS_REQUEST_ID 65f94c30_PSmgbsdBOS1dp72_19628-6657
HTTP_X_FORWARDED_IP 54.160.244.62
HTTP_X_CDN_SRC_PORT 39300
HTTP_CDN_SRC_IP 54.160.244.62
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_X_FORWARDED_FOR 54.160.244.62
HTTP_HOST www.uidir.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME uidir.com
SERVER_PORT 80
SERVER_ADDR 172.28.76.145
REMOTE_PORT 23842
REMOTE_ADDR 163.171.198.160
SERVER_SOFTWARE nginx/1.21.0
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/uidir.com/public
DOCUMENT_URI /index.php
REQUEST_URI /news-8.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/news-8.html
SCRIPT_FILENAME /www/wwwroot/uidir.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710836715.8781
REQUEST_TIME 1710836715
Environment Variablesempty
ThinkPHP Constants
ADDON_PATH /www/wwwroot/uidir.com/addons/
PINYIN_DEFAULT 4096
PINYIN_TONE 2
PINYIN_NO_TONE 4
PINYIN_ASCII_TONE 8
PINYIN_NAME 16
PINYIN_KEEP_NUMBER 32
PINYIN_KEEP_ENGLISH 64
PINYIN_UMLAUT_V 128
PINYIN_KEEP_PUNCTUATION 256