用户“root”@localhost mysql 错误 1045 的访问被拒绝

Gna*_*dra 5 php mysql phpmyadmin mysql-error-1045

我是 PHP 新手。执行我的应用程序时出现以下错误:

在phpMyadmin中的代码是这样的

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
Run Code Online (Sandbox Code Playgroud)

由于我已经采取了备份,我已将上面的代码更改为

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'Pass123';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;
Run Code Online (Sandbox Code Playgroud)

现在我收到以下错误

用户 'root'@'localhost' 访问被拒绝(使用密码:YES)MySQL 错误 #:1045

请让我知道,这里出了什么问题。

sre*_*nth 0

请检查您在此处输入的密码。

当您的密码与原始密码不匹配时,就会出现此类错误。