【发布时间】:2013-10-29 05:28:20
【问题描述】:
我在 PC 上使用 WAMP Server 2.2。在 phpMyAdmin(版本 5.5.24)中,我编辑了“root”用户(使用“localhost”主机)并给它一个密码“root”。事实证明,这是我试图挽回的一个大错误。现在,当我转到 localhost/phpmyadmin/ 时,我会在左侧看到数据库菜单,但主框架有一个错误,内容如下:
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the
connection. You should check the host, username and password in your
configuration and make sure that they correspond to the information given
by the administrator of the MySQL server.
如果我转到 127.0.0.1/phpmyadmin,我确实不会收到错误并且一切正常。
我尝试将用户密码改回无密码;我尝试修改 config.inc.php 文件以添加新密码(但这使 phpMyAdmin 完全出错);我尝试删除并重新创建 root/localhost 用户。似乎没有任何效果。 root/localhost 用户似乎没有密码和所有权限,但错误仍然存在。
有什么想法或如何让该用户的访问权限恢复正常而无需重新安装 WAMP?
【问题讨论】:
-
特权是特定于主机的
-
编辑您的
%windir%\system32\drivers\etc\hosts文件并在其中添加/取消注释127.0.0.1 localhost -
有时可以通过清除所有 cookie 来修复 phpMyAdmin 的登录问题。
-
@xyz,您的评论解决了我的问题。我被卡住了,浪费了我的半天时间。
标签: php mysql phpmyadmin wamp