一、安装mysql
brew install mysql
二、开机启动mysql
brew info mysql
根据提示,设置开机启动
三、设置mysql开启和停止命令
alias mysql-stop='launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist'
alias mysql-start='launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist'