我使用brew安装了mysql:
MacBook-Air-Pavel:mysql paus$ sudo brew install mysql
==> Installing mysql
==> Downloading https://homebrew.bintray.com/bottles/mysql-5.6.24.yosemite.bottle.tar.gz
######################################################################## 100,0%
==> Pouring mysql-5.6.24.yosemite.bottle.tar.gz
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
To have launchd start mysql at login:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
==> Summary
/usr/local/Cellar/mysql/5.6.24: 9719 files, 338M
不幸的是,当我试图staet mysql.server时,它崩溃了这条消息:
MacBook-Air-Pavel:webogram paus$ mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/MacBook-Air-Pavel.local.pid).
MacBook-Air-Pavel:webogram paus$ mysql -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
我不知道为什么会这样。你能帮我避免这个问题吗? 谢谢!