我在 MAMP phpMyAdmin 上工作,一切正常,直到我ALTER TABLE
从 SQL 选项卡查询语句。操作太长而无法结束,所以我决定刷新我的页面。从那时起,我无法再访问 phpMyAdmin 并且我总是收到此消息:
#2002 - Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)
我已经尝试了很多在网上找到的东西,包括 Stackoverflow、Server Fault ......比如重新安装 MAMP、符号链接到/tmp/mysql.sock
、修改config.inc.php
等,但没有任何效果。
当我从命令行运行时,一切都很好mysql
:
$ /Applications/MAMP/Library/bin/mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.29 Source distribution
mysql> SHOW SCHEMAS;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0,65 sec)
mysqld
运行正常:
$ ps -e | grep mysql
7007 ?? 0:00.03 /bin/sh /Applications/MAMP/Library/bin/mysqld_safe --port=8889 --socket=/Applications/MAMP/tmp/mysql/mysql.sock --lower_case_table_names=0 --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --log-error=/Applications/MAMP/logs/mysql_error_log
7141 ?? 0:00.37 /Applications/MAMP/Library/bin/mysqld --basedir=/Applications/MAMP/Library --datadir=/Applications/MAMP/db/mysql --plugin-dir=/Applications/MAMP/Library/lib/plugin --lower-case-table-names=0 --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=8889
并且存在套接字文件:
$ ls -la /Applications/MAMP/tmp/mysql/mysql.sock
srwxrwxrwx 1 user admin 0 21 avr 16:57 /Applications/MAMP/tmp/mysql/mysql.sock
有人遇到过这种问题吗?