[2002] PDOException in Connection.php line 528

  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=127.0.0.1...', 'root', 'zgctwangid', [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 `h...', [], false, true) in Mysql.php line 90
  6. at Mysql->getFields('`head`') in Connection.php line 377
  7. at Connection->getTableInfo('head', 'bind') in Connection.php line 454
  8. at Connection->getFieldsBind('head') in Builder.php line 292
  9. at Builder->buildWhere(object(Query), ['AND' => [['active', '=', 'active']]]) in Builder.php line 264
  10. at Builder->parseWhere(object(Query), ['AND' => [['active', '=', 'active']]]) in Builder.php line 998
  11. at Builder->select(object(Query)) in Connection.php line 1281
  12. at Connection->value(object(Query), ['id'], null) in Query.php line 614
  13. at Query->value('id') in common.php line 26
  14. at qcys('3') in Base.php line 15
  15. at Base->initialize() in Controller.php line 68
  16. at Controller->__construct(object(App))
  17. at ReflectionClass->newInstanceArgs([object(App)]) in Container.php line 439
  18. at Container->invokeClass('app\index\controller...', []) in Container.php line 284
  19. at Container->make('app\index\controller...', []) in App.php line 725
  20. at App->controller('product', 'controller', false, 'Error') in Module.php line 94
  21. at Module->exec() in Dispatch.php line 168
  22. at Dispatch->run() in App.php line 432
  23. at App->think\{closure}(object(Request), object(Closure), null)
  24. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  25. at Middleware->think\{closure}(object(Request))
  26. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  27. at Middleware->dispatch(object(Request)) in App.php line 435
  28. at App->run() in index.php line 21

Environment Variables

GET Data
/index/product/frequency/ysid/3/id/33_html
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
PATH
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;
SYSTEMROOT
C:\Windows
COMSPEC
C:\Windows\system32\cmd.exe
PATHEXT
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR
C:\Windows
PHPRC
D:/phpstudy_pro/Extensions/php/php7.3.4nts
_FCGI_SHUTDOWN_EVENT_
10184
HTTP_CONNECTION
close
SCRIPT_NAME
/index.php
REQUEST_URI
/index/product/frequency/ysid/3/id/33.html
QUERY_STRING
/index/product/frequency/ysid/3/id/33.html
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/1.1
GATEWAY_INTERFACE
CGI/1.1
REDIRECT_QUERY_STRING
/index/product/frequency/ysid/3/id/33.html
REDIRECT_URL
/index/product/frequency/ysid/3/id/33.html
REMOTE_PORT
20000
SCRIPT_FILENAME
F:/300/en.o3ma.com/public/index.php
SERVER_ADMIN
admin@example.com
CONTEXT_DOCUMENT_ROOT
F:/300/en.o3ma.com/public
CONTEXT_PREFIX
REQUEST_SCHEME
http
DOCUMENT_ROOT
F:/300/en.o3ma.com/public
REMOTE_ADDR
165.3.128.227
SERVER_PORT
80
SERVER_ADDR
192.168.0.89
SERVER_NAME
en.o3ma.com
SERVER_SOFTWARE
Apache/2.4.39 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9a mod_log_rotate/1.02
SERVER_SIGNATURE
SystemRoot
C:\Windows
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
en.o3ma.com
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
REDIRECT_STATUS
200
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1638077839.0261
REQUEST_TIME
1638077839
Environment Variablesempty
ThinkPHP Constantsempty