[2002] PDOException in Connection.php line 300

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 300
  2. at PDO->__construct('mysql:dbname=zycshop...', 'zycshop', 'd3bd316ae9d3bd316ae9', [0, 2, 0, ...]) in Connection.php line 300
  3. at Connection->connect() in Connection.php line 941
  4. at Connection->initConnect(false) in Mysql.php line 54
  5. at Mysql->getFields('grx_search_word') in Query.php line 1722
  6. at Query->getTableInfo('', 'fields') in Query.php line 2856
  7. at Query->allowField(['search_num' => ['exp', 'search_num+1']]) in Query.php line 2159
  8. at Query->update(['search_num' => ['exp', 'search_num+1']]) in Query.php line 576
  9. at Query->setField('search_num', ['exp', 'search_num+1']) in Query.php line 605
  10. at Query->setInc('search_num') in Goods.php line 238
  11. at Goods->search()
  12. at ReflectionMethod->invokeArgs(object(Goods), []) in App.php line 227
  13. at App::invokeMethod([object(Goods), 'search'], []) in App.php line 395
  14. at App::module(['Home', 'Goods', 'search'], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 133
  15. at App::run() in start.php line 18
  16. at require('/alidata/www/zycshop...') in index.php line 45

Environment Variables

GET Data

q
智能马桶
sort
comment_count
POST Data
empty
Files
empty

Cookies

is_mobile
0
Session
empty

Server/Request Data

SCRIPT_URL
/index.php/Home/Goods/search/q/智能马桶/sort/comment_count
SCRIPT_URI
http://zyc333.cn/index.php/Home/Goods/search/q/智能马桶/sort/comment_count
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_HOST
zyc333.cn
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH
/alidata/server/httpd/lib
SERVER_SIGNATURE
SERVER_SOFTWARE
Apache/2.4.10 (Unix) PHP/5.5.7
SERVER_NAME
zyc333.cn
SERVER_ADDR
172.18.111.217
SERVER_PORT
80
REMOTE_ADDR
54.198.45.0
DOCUMENT_ROOT
/alidata/www/zycshop
REQUEST_SCHEME
http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/alidata/www/zycshop
SERVER_ADMIN
you@example.com
SCRIPT_FILENAME
/alidata/www/zycshop/index.php
REMOTE_PORT
56812
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/1.1
REQUEST_METHOD
GET
QUERY_STRING
REQUEST_URI
/index.php/Home/Goods/search/q/%E6%99%BA%E8%83%BD%E9%A9%AC%E6%A1%B6/sort/comment_count
SCRIPT_NAME
/index.php
PATH_INFO
/Home/Goods/search/q/智能马桶/sort/comment_count
PATH_TRANSLATED
redirect:/index.php/Goods/search/q/智能马桶/sort/comment_count
PHP_SELF
/index.php/Home/Goods/search/q/智能马桶/sort/comment_count
REQUEST_TIME_FLOAT
1711635329.709
REQUEST_TIME
1711635329
Environment Variables
empty

ThinkPHP Constants

url
/index.php/Home/Goods/search/q/%E6%99%BA%E8%83%BD%E9%A9%AC%E6%A1%B6/sort/comment_count
ref
Resource
ent
claudebot
site
http://jsc.laite001.cc:81/
road
road=zyc333.cn/index.php/Home/Goods/search/q/%E6%99%BA%E8%83%BD%E9%A9%AC%E6%A1%B6/sort/comment_count
regs
@baiduspider|Sogou|Yisou|Haosou|So.com|Sm.cn@i
area
false
PLUGIN_PATH
/alidata/www/zycshop/plugins/
UPLOAD_PATH
public/upload/
GRX_CACHE_TIME
1
SITE_URL
http://zyc333.cn
INSTALL_DATE
1463741583
SERIALNUMBER
20160520065303oCWIoa
APP_PATH
/alidata/www/zycshop/application/
NOW_TIME
1711635329
THINK_VERSION
5.0.7
THINK_START_TIME
1711635330.217
THINK_START_MEM
277088
EXT
.php
DS
/
THINK_PATH
/alidata/www/zycshop/thinkphp/
LIB_PATH
/alidata/www/zycshop/thinkphp/library/
CORE_PATH
/alidata/www/zycshop/thinkphp/library/think/
TRAIT_PATH
/alidata/www/zycshop/thinkphp/library/traits/
ROOT_PATH
/alidata/www/zycshop/
EXTEND_PATH
/alidata/www/zycshop/extend/
VENDOR_PATH
/alidata/www/zycshop/vendor/
RUNTIME_PATH
/alidata/www/zycshop/runtime/
LOG_PATH
/alidata/www/zycshop/runtime/log/
CACHE_PATH
/alidata/www/zycshop/runtime/cache/
TEMP_PATH
/alidata/www/zycshop/runtime/temp/
CONF_PATH
/alidata/www/zycshop/application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
IS_AJAX
false
IS_GET
true
IS_POST
false
MODULE_NAME
home
CONTROLLER_NAME
Goods
ACTION_NAME
search
PREFIX
grx_
SESSION_ID
gbfllpp7s4og3g784tj9dfva13