在OS X上配置phpMyAdmin遇错,求后续排查方案

我看到截图中显示的错误信息,已按以下内容完成所有参数配置,当前使用MAMP应用程序。
Apache port: 8888 Nginx port: 8888 MySQL port: 3306 /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'config'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'root'; $cfg['Servers'][$i]['port'] = '3306'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false; $cfg['Servers'][$i]['socket'] = '/Applications/MAMP/tmp/mysql/mysql.sock';
接下来可以尝试这些解决方法:
- 检查MySQL服务状态:打开MAMP控制面板,确认MySQL服务是否正常启动,未启动则点击Start按钮启动
- 验证socket路径:确认
/Applications/MAMP/tmp/mysql/mysql.sock文件存在,不存在就重启MAMP生成该文件 - 修改host配置:将
$cfg['Servers'][$i]['host']从localhost改为127.0.0.1,绕开socket连接问题 - 排查端口占用:在终端执行
lsof -i :3306,查看3306端口是否被其他程序占用,有占用则关闭对应程序或修改MAMP的MySQL端口 - 重置phpMyAdmin配置:备份当前
config.inc.php后删除该文件,重启MAMP让phpMyAdmin自动生成默认配置,再重新修改参数 - 验证MySQL账号:打开MAMP自带的终端,执行
mysql -uroot -proot,确认root账号能正常登录,无法登录则重置root密码
内容的提问来源于stack exchange,提问作者newuser_
相关产品推荐
相关产品推荐

