CODIEZ

second-person plural present subjunctive of coder

Uninstall MySQL & MacPorts, Reinstall MySQL With Homebrew on Mac OSX

I have recently have to set up my dev environment once again, which can be quite a bit of a pain, especially if you do not have something like boxen.

This time however i decided to avoid macports all together, one of the “benefits” of macports over homebrew is the ability to run different versions since macports will install into /opt , though its a feature i never used, and i have had a bunch of strange build incompatabilities that has taken me quite a bit of time to debug.

Here are the steps

Uninstall macports

1
sudo port -fp uninstall --follow-dependents installed
1
2
3
4
5
6
7
8
9
10
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

Uninstall MySQL

  1. Backup any databases you have using mysqldump
  2. Stop MySQL if it is currently running, under settings > mysql

and then run:

1
2
3
4
5
6
7
8
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*

You may also need to edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

Install Homebrew & MySQL

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

Welcome to nirvana

:)

Seriously, i have not yet had any compatibility or weird build errors with homebrew.

Comments