无法启动 phpMyAdmin.不断收到#2002 套接字错误

2022-01-05 00:00:00 sockets macos mysql phpmyadmin

过去 12 小时我一直在尝试设置 mysql 和 phpMyAdmin,但没有成功.是的,经过数小时的 Google 搜索后,我知道这是一个常见问题,并且我已经阅读过有关 stackoverflow 的类似查询,但仍然无法提供解决方案.....

I've been trying to set mysql and phpMyAdmin for the last 12 hours, without any success. And yes, after hours and hours of Google-ing I know that is a common problem and I've read similar queries on stackoverflow but still can't come with the solution.....

我已经尝试了一切 - 从改变

I've tried everything - from changing the

$cfg['Servers'][$i]['port']

config.inc.php文件中3306127.0.0.1....

config.inc.php 文件中输入套接字路径 - tmp/mysql.php/var/mysql/mysql.sock.

typing the socket path in the config.inc.php file - both tmp/mysql.php and the /var/mysql/mysql.sock.

我已尝试更改 my.cnf 文件和 php.ini 中的套接字路径....但我一直收到相同的错误:

I've tried changing the socket path in the my.cnf file and the php.ini....but I keep getting the same error:

#2002 - No such file or directory
The server is not responding (or the local server's socket is not correctly configured).

我使用 MySQL (5.1.65)、PhpMyAdmin (3.5.2.2) 和 PHP (5.3.8).

I'm using MySQL (5.1.65), PhpMyAdmin (3.5.2.2) and PHP (5.3.8).

推荐答案

我最近在 Mac OS Sierra 上也遇到了这个问题.Apache 服务器正在工作,但 mysql 没有.在寻找解决方案后,阅读了很多帖子,我找到了这个解决方案.它奏效了!

I have recently encountered this problem on Mac OS Sierra too. Apache server is working but mysql is not. After searching for a solution, reading lots of posts I found this solution. And it worked!

解决方案是导航到 mysql 文件夹,在我的例子中,

The solution is to navigate to the mysql folder, in my case its,

/Applications/MAMP/db/mysql56/

并删除除文件夹之外的所有文件.然后再次重启 MAMP.

and remove all the files except folders. Then restart MAMP again.

相关文章