用的开发环境是wamp,今天登录 phpMyAdmin 时,出现错误提示:
#1045-access denied for user:'root@localhost'(Using password"YES)
phpMyAdmin 尝试连接到 MySQL 服务器,但服务器拒绝连接。您应该检查配置文件中的主机、用户名和密码,并确认这些信息与 MySQL 服务器管理员所给出的信息一致。
按照网上的方法,找到 phpmyadmin 目录下的 config.inc.php 文件,打开设置密码,重启 wamp,but 依然没用。
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '你的MySQL密码';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
================================
最后的解决办法:
删掉 config.inc.php 文件,然后出现登录框,于是可以登录了。