且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

phpMyAdmin抛出#2002无法登录mysql服务器phpmyadmin

更新时间:2021-08-04 21:23:38

如果您在登录 phpmyadmin 时遇到 #2002 无法登录 MySQL 服务器 错误,请尝试编辑 phpmyadmin/config.inc.php 并更改:

If you're getting the #2002 Cannot log in to the MySQL server error while logging in to phpmyadmin, try editing phpmyadmin/config.inc.php and change:

$cfg['Servers'][$i]['host'] = 'localhost';

到:

$cfg['Servers'][$i]['host'] = '127.0.0.1';

来自 Ryan 博客的解决方案一个>

编辑(2015 年 3 月 20 日):

请注意,如果您是全新安装,则 config.inc.php 可能不存在.您需要重命名/复制 config.sample.inc.php 然后更改相关行

Note that if you're on a fresh install, config.inc.php may not exist. You need to rename / copy config.sample.inc.php and then change the relevant line