Install MySQL on Mac OS X via Homebrew

A quick tip for those of you doing MAMP development: how to easily install and run MySQL via Homebrew.

From a terminal:

$ brew install mysql

Seems too easy, right? If you want it to start automatically on boot, you'll also need to run the following:

$ ln -sfv /usr/local/opt/mysql/\*.plist ~/Library/LaunchAgents $ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist $ mysql.server start

Tip via