Skip to content

Instantly share code, notes, and snippets.

@stillfinder
Last active January 17, 2019 22:24
Show Gist options
  • Save stillfinder/d35cd54805105a4a8e4aed8b019afaae to your computer and use it in GitHub Desktop.
Save stillfinder/d35cd54805105a4a8e4aed8b019afaae to your computer and use it in GitHub Desktop.
Uninstall MySql on Mac script
#!/bin/bash
brew remove [email protected]
# Or 'brew remove mysql'
brew cleanup
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*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
#(Edit /etc/hostconfig) sudo vi /etc/hostconfig (Remove line MYSQLCOM=-YES)
sudo sed -i -e 's/'"MYSQLCOM=-YES"'/'""'/g' /etc/hostconfig
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment