修复对phpMyAdmin用户'root'@'localhost'的访问被拒绝的问题 [英] Fix Access denied for user 'root'@'localhost' for phpMyAdmin

查看:102
本文介绍了修复对phpMyAdmin用户'root'@'localhost'的访问被拒绝的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在PC上使用WAMP Server 2.2.在phpMyAdmin(版本5.5.24)中,我编辑了"root"用户(带有"localhost"主机),并为其指定了密码"root".原来这是我要还原的一个大错误.现在,当我进入 localhost/phpmyadmin/时,我会在左侧看到数据库菜单,但是主框架上显示错误消息:

I'm using WAMP Server 2.2 on a PC. In phpMyAdmin (version 5.5.24) I edited the 'root' user (with 'localhost' host) and gave it a password of 'root'. This turned out to be a big mistake that I'm trying to revert. Now when I go to localhost/phpmyadmin/ I get the menu of databases on the left, but the main frame has an error that reads:

#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 ,我会收到错误消息,并且一切正常.

If I go to 127.0.0.1/phpmyadmin, I do not get the error and everything works fine.

我尝试将用户密码改回无密码;我试图修改config.inc.php文件以添加新密码(但这使phpMyAdmin完全出错);我尝试删除并重新创建root/localhost用户.似乎没有任何作用. root/localhost用户似乎没有密码和所有特权,但是错误仍然存​​在.

I tried changing the user's password back to no password; I tried modifying config.inc.php file to add the new password (but that made phpMyAdmin error-out completely); I tried removing and recreating the root/localhost user. Nothing seems to work. The root/localhost user appears to have no password and all privileges, but the error remains.

是否有任何想法或如何使该用户的访问权限恢复正常而无需重新安装WAMP?

Any ideas or how I can get this user's access back to normal without having to reinstall WAMP?

推荐答案

C:\wamp\apps\phpmyadmin3.5.1下查找config.inc文件 在此文件中找到 这一行

Find config.inc file under C:\wamp\apps\phpmyadmin3.5.1 Inside this file find this one line

$cfg['Servers'][$i]['password'] =";

并替换为

$cfg['Servers'][$i]['password'] = 'Type your root password here';

这篇关于修复对phpMyAdmin用户'root'@'localhost'的访问被拒绝的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆