phpMyAdmin - 无法连接 - 无效设置 - 自从我添加了 root 密码后 - 被锁定

phpMyAdmin - 无法连接 - 无效设置 - 自从我添加了 root 密码后 - 被锁定

我运行 XAMPP,几天前我通过 phpmyadmin 设置了 root 密码,从那一刻起我就无法访问 phpMyAdmin

我关注了此链接但那里一切似乎都很好(在 config.inc.php 中)。我甚至尝试完全卸载 xampp,重新启动 windows,然后重新安装 xampp,但仍然指向 localhost/phpmyadmin 我收到以下错误

MySQL said: 
Cannot connect: invalid settings. 
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.

我还尝试按照 mysql 网站帮助中提供的方法通过 mysqld.bat 重置 root 密码,但无济于事

请帮忙!

答案1

编辑 config.inc.php 文件。您可以在“C:\xampp\phpmyadmin\”中找到它并更改~line 21:

$cfg['Servers'][$i]['password'] = ''; to $cfg['Servers'][$i]['password']  = 'yourPassHere';

保存并再次访问 phpmyadmin。这样就无需像 Maxwell 所说的那样更改密码。

答案2

就我而言,将“127.0.0.1”更改为“localhost”后问题已得到解决!

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';

至 >>>

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';

好工作

答案3

您可以通过运行以下命令重置 Mysql 密码:--skip-授权表选项,接下来你将能够使用 root 用户登录而无需密码并发出

UPDATE user SET Password=PASSWORD('newpwd') WHERE User='root';
flush privileges;
exit;

接下来正常重启MySQL。

希望这可以帮助。

答案4

我找到了修复方法。去config.inc.php查找以下代码行:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123456';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Lang'] = '';

如果不允许密码,则true进行设置false。如果密码为空,请输入您在出现错误消息之前从 phpmyadmin 仪表板更改的密码值。

相关内容