[2002] PDOException in Connection.php line 295

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

  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...', 'htpur_com', 'X4ybijAhNYjWMap3', [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 `g...', [], false, true) in Mysql.php line 65
  6. at Mysql->getFields('gm_language') in Query.php line 1921
  7. at Query->getTableInfo('gm_language', 'type') in Query.php line 1969
  8. at Query->getFieldsType('gm_language') in Query.php line 1975
  9. at Query->getFieldsBind('gm_language') in Builder.php line 270
  10. at Builder->buildWhere(['AND' => [['exp', object(Expression)]]], ['where' => ['AND' => [['exp', object(Expression)]]], 'field' => ['mark'], 'table' => 'gm_language', ...]) in Builder.php line 240
  11. at Builder->parseWhere(['AND' => [['exp', object(Expression)]]], ['where' => ['AND' => [['exp', object(Expression)]]], 'field' => ['mark'], 'table' => 'gm_language', ...]) in Builder.php line 719
  12. at Builder->select(['where' => ['AND' => [['exp', object(Expression)]]], 'field' => ['mark'], 'table' => 'gm_language', ...]) in Query.php line 2462
  13. at Query->getPdo() in Query.php line 491
  14. at Query->column('mark') in common.php line 107
  15. at get_langs() in route.php line 40
  16. at include('/www/wwwroot/htpur.c...') in App.php line 641
  17. at App::routeCheck(object(Request), ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 116
  18. at App::run() in start.php line 19
  19. at require('/www/wwwroot/htpur.c...') in index.php line 18

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/www/wwwroot/htpur.com/index.php
QUERY_STRING
s=/field.html
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/field.html
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/www/wwwroot/htpur.com
SERVER_PROTOCOL
HTTP/1.1
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.18.0
REMOTE_ADDR
168.76.6.176
REMOTE_PORT
20000
SERVER_ADDR
172.19.0.6
SERVER_PORT
80
SERVER_NAME
htpur.com
REDIRECT_STATUS
200
PATH_INFO
/field.html
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_HOST
www.htpur.com
HTTP_ACCEPT
*/*
HTTP_ACCEPT_ENCODING
deflate, gzip
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1653431168.1189
REQUEST_TIME
1653431168
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/htpur.com/application/
THINK_VERSION
5.0.24
THINK_START_TIME
1653431168.1194
THINK_START_MEM
267376
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/htpur.com/thinkphp/
LIB_PATH
/www/wwwroot/htpur.com/thinkphp/library/
CORE_PATH
/www/wwwroot/htpur.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/htpur.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/htpur.com/
EXTEND_PATH
/www/wwwroot/htpur.com/extend/
VENDOR_PATH
/www/wwwroot/htpur.com/vendor/
RUNTIME_PATH
/www/wwwroot/htpur.com/runtime/
LOG_PATH
/www/wwwroot/htpur.com/runtime/log/
CACHE_PATH
/www/wwwroot/htpur.com/runtime/cache/
TEMP_PATH
/www/wwwroot/htpur.com/runtime/temp/
CONF_PATH
/www/wwwroot/htpur.com/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
HELPER_PATH
/www/wwwroot/htpur.com/application/common/helper/
INCLUDE_PATH
/www/wwwroot/htpur.com/application/common/include/
IS_CLI
false
IS_WIN
false
PHP_INT_MIN
-9223372036854775808
__ROOT__
PUBLIC_PATH
/public