您的位置:首页 > 博客中心 > 数据库 >

Mac启动mysql出现错误

时间:2022-03-14 03:49

Mac启动mysql出现错误error: ‘Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)‘

刚刚升级mac到10.10,重新用Homebrew安装了出现提示:

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

参考 ,使用mysqld stop停止,然后用mysql.server restart解决了问题

按照Homebrew的安装提示,可能可以使用launchctl解决问题,但目前不知道是什么用处,这里先记录一下

热门排行

今日推荐

热门手游