修复phpMyAdmin用户'root'@'localhost'拒绝访问

我在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?


C:wampappsphpmyadmin3.5.1下找到config.inc文件在这个文件里找到这一行

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

并用其替换

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

我在更改数据库中的密码后遇到了同样的问题..我所做的是编辑更新后的密码,我之前更改过密码,并且我没有更新config.inc.php和D中相同的用户名: XAMP phpMyAdmin的 config.inc

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = **'root'**;
$cfg['Servers'][$i]['password'] = **'epufhy**';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

在phpMyAdmin页面中更改我的“root”密码后,我遇到了同样的问题,并且正在从互联网寻找解决方案,但未能获得我需要的答案,因此我检查了phpMyAdmin目录中的文档。

转到并编辑该文件

modulesphpmyadmin414x140123114237config.sample.inc.php

寻找线路

$cfg['Servers'][$i]['auth_type'] = 'config'

并将'config'更改为'http' ,这将允许您在使用浏览器访问phpMyAdmin页面时输入用户名和密码。

要么

请参阅相同phpMyAdmin目录下的文档文件( phpmyadmin414x140123114237dochtml )以获取帮助并搜索$cfg['Servers'][$i]['auth_type'] ,您将看到4个选项供您选择登录到您的phpMyAdmin页面。

链接地址: http://www.djcxy.com/p/69297.html

上一篇: Fix Access denied for user 'root'@'localhost' for phpMyAdmin

下一篇: phpMyAdmin Access denied