作者:森tu罗宝殿 | 来源:互联网 | 2023-05-18 11:00
嗨,我知道这是一个古老的问题,但我已经尝试了许多答案和指南,但都是徒劳的.之前我在本地机器上使用的是没有密码的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
1> Holger..:
打开xampp/phpMyAdmin/config.inc并更改该行
$cfg['Servers'][$i]['auth_type'] = 'config';
至
$cfg['Servers'][$i]['auth_type'] = 'COOKIE';
然后PhpMyAdmin将显示一个登录屏幕,您可以在其中输入您的用户名和密码.