更新时间:2021-12-13 22:41:04
如果登录phpmyadmin时出现#2002 Cannot log in to the MySQL server
错误,请尝试编辑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