安装错误请教帮忙SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost'

win10  xampp安装测试  数据库密码什么的设置都对了,但是不知道为什么在设置完数据库下一步后出现如下错误,求请教帮忙 

QQ截图20180220123752.png


[1045] PDOException in Connection.php line 501

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

try {
if (empty($config['dsn'])) {
$config['dsn'] = $this->parseDsn($config);
}
if ($config['debug']) {
$startTime = microtime(true);
}
$this->links[$linkNum] = new PDO($config['dsn'], $config['username'], $config['password'], $params);
if ($config['debug']) {
// 记录数据库连接信息
$this->log('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $config['dsn']);
}
} catch (\PDOException $e) {
if ($autoConnection) {
$this->log($e->getMessage(), 'error');
return $this->connect($autoConnection, $linkNum);

Call Stack

in Connection.php line 501
at PDO->__construct('mysql:host=127.0.0.1...', 'root', '123456', [0, 2, 0, ...]) in Connection.php line 501
at Connection->connect() in Connection.php line 1926
at Connection->initConnect(true) in Connection.php line 704
at Connection->execute('CREATE DATABASE IF N...', ) in Query.php line 333
at Query->execute('CREATE DATABASE IF N...') in Index.php line 79
at Index->config(object(Query), ['admin', 'admin', 'admin', ...])
at ReflectionMethod->invokeArgs(object(Index), [['mysql', '127.0.0.1', 'weixin', ...], ['admin', 'admin', 'admin', ...]]) in Container.php line 214
at Container->invokeMethod([object(Index), 'config'], ['db' => ['mysql', '127.0.0.1', 'weixin', ...], 'admin' => ['admin', 'admin', 'admin', ...]]) in Module.php line 124
at Module->run() in Url.php line 26
at Url->run() in App.php line 361
at App->run() in index.php line 20

Environment Variables

GET Dataempty

POST Data
db [ "mysql", "127.0.0.1", "weixin", "root", "123456", "3306", "rh_" ]
admin [ "admin", "admin", "admin", "admin@admin.com" ]

Filesempty

Cookies
PHPSESSID 0d19gar3rltv0a6g9ovghlg96o

Session
think_ { "error": false, "step": 1, "admin_info": { "username": "admin", "password": "admin", "repassword": "admin", "email": "admin@admin.com" }, "db_config": { "type": "mysql", "hostname": "127.0.0.1", "database": "weixin", "username": "root", "password": "123456", "hostport": "3306", "prefix": "rh_" } }

Server/Request Data
REDIRECT_MIBDIRS E:/xamp/php/extras/mibs
REDIRECT_MYSQL_HOME \xampp\mysql\bin
REDIRECT_OPENSSL_CONF E:/xamp/apache/bin/openssl.cnf
REDIRECT_PHP_PEAR_SYSCONF_DIR \xampp\php
REDIRECT_PHPRC \xampp\php
REDIRECT_TMP \xampp\tmp
REDIRECT_STATUS 200
MIBDIRS E:/xamp/php/extras/mibs
MYSQL_HOME \xampp\mysql\bin
OPENSSL_CONF E:/xamp/apache/bin/openssl.cnf
PHP_PEAR_SYSCONF_DIR \xampp\php
PHPRC \xampp\php
TMP \xampp\tmp
HTTP_HOST 127.0.0.1
HTTP_CONNECTION keep-alive
CONTENT_LENGTH 190
HTTP_CACHE_CONTROL max-age=0
HTTP_ORIGIN 27.0.0.1
HTTP_UPGRADE_INSECURE_REQUESTS 1
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
CONTENT_TYPE application/x-www-form-urlencoded
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER /weixin/install/index/config.html
HTTP_ACCEPT_ENCODING gzip, deflate, br
HTTP_ACCEPT_LANGUAGE zh-CN,zh;q=0.8
HTTP_COOKIE PHPSESSID=0d19gar3rltv0a6g9ovghlg96o
PATH C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;d:\Program Files (x86)\WinSCP\;C:\Users\何洁\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
SERVER_SIGNATURE <address>Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.2 Server at 127.0.0.1 Port 80</address>
SERVER_SOFTWARE Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.2
SERVER_NAME 127.0.0.1
SERVER_ADDR 127.0.0.1
SERVER_PORT 80
REMOTE_ADDR 127.0.0.1
DOCUMENT_ROOT E:/xamp/htdocs
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT E:/xamp/htdocs
SERVER_ADMIN postmaster@localhost
SCRIPT_FILENAME E:/xamp/htdocs/weixin/index.php
REMOTE_PORT 65098
REDIRECT_URL /weixin/install/index/config.html
REDIRECT_QUERY_STRING s=install/index/config.html
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD POST
QUERY_STRING s=install/index/config.html
REQUEST_URI /weixin/install/index/config.html
SCRIPT_NAME /weixin/index.php
PHP_SELF /weixin/index.php
REQUEST_TIME_FLOAT 1519101350.873
REQUEST_TIME 1519101350
PATH_INFO install/index/config.html

Environment Variablesempty

ThinkPHP Constants
ENTR_PATH
ROOT_PATH E:\xamp\htdocs\weixin/
DS \
APP_PATH E:\xamp\htdocs\weixin/application/
ADDON_PATH E:\xamp\htdocs\weixin/addons/
ADDON_ROUTE /app/
EXTEND_PATH E:\xamp\htdocs\weixin/extend/
IS_WRITE true
MODULE_NAME install
CONTROLLER_NAME index
ACTION_NAME config
已邀请:

geeson

赞同来自:

一般是密码错误的问题,你重置一下 MYSQL 密码,然后重启 MYSQL

要回复问题请先登录注册