$ brew install mysql
をするとmysql5.6が入るので(20140711現在)
$ brew tap homebrew/versions
$ brew install mysql55
==> Downloading http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.30.tar.gz
Already downloaded: /Library/Caches/Homebrew/mysql55-5.5.30.tar.gz
==> cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql55/5.5.30 -DMYSQL_DATADIR=/usr/
==> make
==> make install
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
This formula is keg-only, so it was not symlinked into /usr/local.
Conflicts with mysql, mariadb, percona-server, mysql-cluster, etc.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/mysql55/lib
CPPFLAGS: -I/usr/local/opt/mysql55/include
To reload mysql55 after an upgrade:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql55.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql55.plist
==> Summary
/usr/local/Cellar/mysql55/5.5.30: 6406 files, 220M, built in 4.4 minutes
$ brew link mysql55 --force
Linking /usr/local/Cellar/mysql55/5.5.30... 134 symlinks created
$ sudo mysql_install_db --verbose --user=`whoami` --basedir=/usr/local/Cellar/mysql55/5.5.30 --datadir=/usr/local/var/mysql --tmpdir=/tmp