在Mac下启动不了Mysql

执行mysql -uroot -p 会报错

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

原因是根本没启动mysql,后来又更改/tmp的权限还是不起作用。
终于
sudo /usr/local/mysql/bin/mysqld_safe

通过这种古老的方法,第一次可以启动了。还是心有不甘,遍寻了google,折腾了将近3个小时才找到答案,答案就是“It is a bug!”
Riquez说:
I began to think that mysql 5.5 is just not playing well with OS 10.6.5.
ekkedesig说:It is clear that MySQL 5.5 distribution from mysql.com is aimed at OS X Server edition, and is very problematic for the regular desktop version.
按照Riquez的方法卸载mysql5.5

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*

重新下载了mysql-5.1.54-osx10.6-x86.dmg安装,重启,成功!

你可能感兴趣的:(在Mac下启动不了Mysql)