msbsza
Last Updated: February 25, 2016
·
594
· ismail

Reinstall MySQL with homebrew on MacOSX

This tip covers uninstalling MacPorts, MySQL, and reinstalling MySQL with HomeBrew.

Remove Macports:

sudo port -fp uninstall --follow-dependents installed

sudo rm -rf /opt/local
sudo rm -rf /Applications/DarwinPorts
sudo rm -rf /Applications/MacPorts
sudo rm -rf /Library/LaunchDaemons/org.macports.*
sudo rm -rf /Library/Receipts/DarwinPorts*.pkg
sudo rm -rf /Library/Receipts/MacPorts*.pkg
sudo rm -rf /Library/StartupItems/DarwinPortsStartup
sudo rm -rf /Library/Tcl/darwinports1.0
sudo rm -rf /Library/Tcl/macports1.0
sudo rm -rf ~/.macports

Remove MySQL:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo 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*
rm -rf ~/Library/PreferencePanes/My*

Install HomeBrew & MySQL:

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install mysql

Originally blogged at: (http://blog.codiez.co.za/2013/08/uninstall-mysql-macports-install-homebrew-mac-osx/)