[英]Access denied for phpMyAdmin after changing password,config.inc.php only readable
[英]XAMPP phpMyadmin: Access denied after changing password
嗨,我知道这是一个古老的问题,但我已经尝试了许多答案和指南,但都是徒劳的。 之前我在本地机器上使用的是没有密码的phpmyadmin,我使用命令提示符在Windows上使用以下命令更改了密码
mysqladmin.exe -u root密码root
从那时起,我无法打开我的localhost / phpmyadmin,我得到以下错误
1045 - 用户'root'@'localhost'拒绝访问(使用密码:否)
我试过更改config.inc.php这个文件的当前状态如下
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
我尝试从localhost / security.php更改密码,并将密码更改为123 。 我还尝试通过打开resetroot.bat批处理文件来重置 root密码。 我认真地认为我搞砸了所以如果有人能在这里帮助我,我将感激不尽。 我在Windows 7上使用Xampp
编辑此外,我想告诉你,我已经尝试给新密码
$cfg['Servers'][$i]['password'] = '';
还有
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
将用户更改为root
打开xampp / phpMyAdmin / config.inc并更改该行
$cfg['Servers'][$i]['auth_type'] = 'config';
至
$cfg['Servers'][$i]['auth_type'] = 'cookie';
然后PhpMyAdmin将显示一个登录屏幕,您可以在其中输入您的用户名和密码。
您可以使用命令提示符将root密码定义为“root”,因此在config中您必须使用相同的密码:
$cfg['Servers'][$i]['password'] = 'root';
有一个名为resetroot.bat的批处理文件位于xammp文件夹'C:\\ xampp \\ mysql'中运行此文件,它将删除phpadmin密码。 然后,您需要做的就是在xammp中启动MySQL服务,然后单击管理按钮。
您必须更改配置中的密码如果您忘记了密码,请单击xampp根文件夹中mysql文件夹中的重置密码.bat文件
$cfg['server'][$i]['password'] = 'PassWordHere'
还要将更改还原到PMA配置,因为这可能会导致事情发生
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.