安装时数据库报错无法连接?客户端能连上,MYSQL...

数据库就装在服务器本地,用客户端连接又是正常的...
 
自己手动创建一个数据库行不行?
 
错误提示
 SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

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']);
}
return $this->links[$linkNum];
} catch (\PDOException $e) {
if ($autoConnection) {
 
 
 
已邀请:

ghost295

赞同来自:

Call Stack

in Connection.php line 528
at PDO->__construct('mysql:host=127.0.0.1...', 'root', 'ghost295', [0, 2, 0, ...]) in Connection.php line 528
at Connection->connect() in Connection.php line 2022
at Connection->initConnect(true) in Connection.php line 717
at Connection->execute('CREATE DATABASE IF N...', [], object(Query)) in Query.php line 329
at Query->execute('CREATE DATABASE IF N...') in Index.php line 83
at Index->config(object(Query), ['admin', '1234', '1234', ...]) 
at ReflectionMethod->invokeArgs(object(Index), [['mysql', '127.0.0.1', 'rhaphp', ...], ['admin', '1234', '1234', ...]]) in Container.php line 395
at Container->invokeReflectMethod(object(Index), object(ReflectionMethod), ['db' => ['mysql', '127.0.0.1', 'rhaphp', ...], 'admin' => ['admin', '1234', '1234', ...]]) in Module.php line 132
at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null) 
at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
at Middleware->think\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
at Middleware->dispatch(object(Request), 'controller') in Module.php line 137
at Module->exec() in Dispatch.php line 168
at Dispatch->run() in App.php line 432
at App->think\{closure}(object(Request), object(Closure), null) 
at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
at Middleware->think\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
at Middleware->dispatch(object(Request)) in App.php line 435
at App->run() in index.php line 21

ghost295

赞同来自:

md,我蠢了,密码填错了  “0” 和 “o” 分不清楚,自己手写的记录的。。。

要回复问题请先登录注册