mac 彻底删除mysql 8.0

今天在使用mysql 8.0的时候出现了问题,经过多次抢救无效的情况下,决定卸载了mysql,这里记录一下卸载的过程:

1. 打开终端

2. 检查mysql进程:

ps -ax | grep mysql

停止或者杀死任何mysql进程

3. 分析homebrew的mysql:

brew remove mysql
brew cleanup

4. 移除文件:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*

5.卸载以前的自动登陆:

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

6.移除以前的mysql偏好:

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*

最后可以选择重启一下电脑

7. 最后尝试用mysql命令启动,应该是没有该命令,否则就是未卸载干净

参考文献

[1]. How do you uninstall MySQL from Mac OS X?. https://stackoverflow.com/questions/1436425/how-do-you-uninstall-mysql-from-mac-os-x

 

你可能感兴趣的:(mac 彻底删除mysql 8.0)