MacOS使用homebrew安装mysql出现错误的解决办法

如果出现了ERROR! The server quit without updating PID file这种错误, 而你实在解决不了了, 试一试以下的方法

# 首先清理掉之前安装mysql的残余
brew remove mysql
brew cleanup
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /usr/local/var/mysql

# 然后安装mysql
brew install mysql
mysqld --initialize --explicit_defaults_for_timestamp
mysql.server start # no sudo!

你可能感兴趣的:(MacOS使用homebrew安装mysql出现错误的解决办法)