[1045] PDOException in Connection.php line 277

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

  1. $this->resultSetType = $config['resultset_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 277
  2. at PDO->__construct('mysql:dbname=hbhdxf;...', 'root', '961acf8452b8f584947b...', [0, 2, 0, ...]) in Connection.php line 277
  3. at Connection->connect() in Connection.php line 838
  4. at Connection->initConnect(true) in Mysql.php line 52
  5. at Mysql->getFields('txht_product') in Query.php line 1378
  6. at Query->getTableInfo('txht_product', 'type') in Query.php line 1425
  7. at Query->getFieldsType(['where' => ['AND' => ['status' => 1, 'is_top' => 1]], 'field' => ['id', 'pid', 'title', ...], 'order' => 'add_time desc,is_top...', ...]) in Query.php line 1431
  8. at Query->getFieldsBind(['where' => ['AND' => ['status' => 1, 'is_top' => 1]], 'field' => ['id', 'pid', 'title', ...], 'order' => 'add_time desc,is_top...', ...]) in Builder.php line 225
  9. at Builder->buildWhere(['AND' => ['status' => 1, 'is_top' => 1]], ['where' => ['AND' => ['status' => 1, 'is_top' => 1]], 'field' => ['id', 'pid', 'title', ...], 'order' => 'add_time desc,is_top...', ...]) in Builder.php line 203
  10. at Builder->parseWhere(['AND' => ['status' => 1, 'is_top' => 1]], ['where' => ['AND' => ['status' => 1, 'is_top' => 1]], 'field' => ['id', 'pid', 'title', ...], 'order' => 'add_time desc,is_top...', ...]) in Builder.php line 576
  11. at Builder->select(['where' => ['AND' => ['status' => 1, 'is_top' => 1]], 'field' => ['id', 'pid', 'title', ...], 'order' => 'add_time desc,is_top...', ...]) in Query.php line 1877
  12. at Query->select() in Index.php line 55
  13. at Index->index()
  14. at ReflectionMethod->invokeArgs(object(Index), []) in App.php line 226
  15. at App::invokeMethod([object(Index), 'index']) in App.php line 359
  16. at App::module(['', null, null], ['app_namespace' => 'app', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 134
  17. at App::run() in start.php line 18
  18. at require('C:\WWW\hbhdxf\thinkp...') in index.php line 17

Environment Variables

GET Dataempty
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\WindowsPowerShell\v1.0\;;C:\Program Files\python;C:\Program Files\python\Scripts;;C:\BtSoft\panel\script;C:\Windows\system32\config\systemprofile\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
_FCGI_SHUTDOWN_EVENT_
3944
HTTP_CONNECTION
close
SCRIPT_NAME
/index.php
REQUEST_URI
/
QUERY_STRING
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/1.1
GATEWAY_INTERFACE
CGI/1.1
REMOTE_PORT
20000
SCRIPT_FILENAME
C:/WWW/hbhdxf/public/index.php
SERVER_ADMIN
webmaster@example.com
CONTEXT_DOCUMENT_ROOT
C:/WWW/hbhdxf/public
CONTEXT_PREFIX
REQUEST_SCHEME
http
DOCUMENT_ROOT
C:/WWW/hbhdxf/public
REMOTE_ADDR
154.210.68.114
SERVER_PORT
80
SERVER_ADDR
172.31.114.219
SERVER_NAME
www.hbhdxf.cn
SERVER_SOFTWARE
Apache/2.4.46 (Win32) OpenSSL/1.1.1g mod_fcgid/2.3.9a
SERVER_SIGNATURE
SystemRoot
C:\Windows
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.hbhdxf.cn
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1614896646.87
REQUEST_TIME
1614896646
Environment Variablesempty
ThinkPHP Constants
APP_PATH
C:\WWW\hbhdxf\public/../application/
THINK_VERSION
5.0.0
THINK_START_TIME
1614896646.871
THINK_START_MEM
365976
EXT
.php
DS
\
THINK_PATH
C:\WWW\hbhdxf\thinkphp\
LIB_PATH
C:\WWW\hbhdxf\thinkphp\library\
CORE_PATH
C:\WWW\hbhdxf\thinkphp\library\think\
TRAIT_PATH
C:\WWW\hbhdxf\thinkphp\library\traits\
ROOT_PATH
C:\WWW\hbhdxf\public/..\
EXTEND_PATH
C:\WWW\hbhdxf\public/..\extend\
VENDOR_PATH
C:\WWW\hbhdxf\public/..\vendor\
RUNTIME_PATH
C:\WWW\hbhdxf\public/..\runtime\
LOG_PATH
C:\WWW\hbhdxf\public/..\runtime\log\
CACHE_PATH
C:\WWW\hbhdxf\public/..\runtime\cache\
TEMP_PATH
C:\WWW\hbhdxf\public/..\runtime\temp\
CONF_PATH
C:\WWW\hbhdxf\public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
true