mac 安装 mysql 5.7
卸载以前的版本 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- rm -rf ~/Library/PreferencePanes/My* sudo rm -rf /Library/Receipts/mysql* sudo rm -rf /Library/Receipts/MySQL* sudo rm -rf /private/var/db/receipts/mysql brew services list brew services stop mysql@5.6 brew remove mysql@5.6 rm -rf /usr/local/var/mysql 安装 brew install mysql@5.7 brew services start mysql@5.7 初始化,记下初始密码 mysqld --initialize --datadir=/data/mysql 修改 plist 中的 datadir vim ~/Library