Mysql PrefPane无法运行 - OS X.

时间:2011-11-06 21:18:09

标签: mysql macos osx-lion

当我尝试从PrefPane启动MySQL时,它会询问我的密码,然后它一直说MySQL服务器的红色为stopped

它没有开始。

$ mysqladmin start
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
$ mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

当我搜索mysql的流程时,这就是我所看到的:

$ ps wwaux | grep mysqld | grep -v grep
_mysql           203   0.0  0.5  2518204  19288   ??  S     3:30PM   0:23.25 /opt/local/libexec/mysqld --basedir=/opt/local --datadir=/opt/local/var/db/mysql5 --user=_mysql --log-error=/opt/local/var/db/mysql5/localhost.err --pid-file=/opt/local/var/db/mysql5/localhost.pid --socket=/tmp/mysql.sock --port=3306
root              75   0.0  0.0  2435492    884   ??  S     3:30PM   0:00.04 /bin/sh /opt/local/lib/mysql5/bin/mysqld_safe --datadir=/opt/local/var/db/mysql5 --pid-file=/opt/local/var/db/mysql5/localhost.pid

思想?

2 个答案:

答案 0 :(得分:0)

检查MySQL端口是否已打开:

telnet localhost 3306

检查mysql.sock文件是否存在并在必要时修复其权限:

sudo chown _mysql:wheel /tmp/mysql.sock

尝试通过终端停止并启动MySQL:

sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

如果没有任何帮助,请尝试重置MySQL root密码和/或重新安装MySQL。

答案 1 :(得分:0)

事实证明,mysqld进程正在运行并且停滞不前。所以我刚进入Activity Monitor并将其杀死,并重新启动它。

它现在有效。