If you find that you need to have a particular version of MySQL installed on your OSX machine (e.g. to match the version running in production) but you already have a different version of MySQL installed via Homebrew, then the notes below may help you to replace the installed version with the one you need.
DISCLAIMER: The following instructions involve the complete removal of the existing MySQL installation, including any databases. Proceed with caution, and double check every command–this is just meant to be a rough guide to an approach you can take to achieve the desired result.
homebrew.mxcl.mysql.plistis present then:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
- Stop the MySQL server process:
sudo mysql.server stop
brew remove mysql
brew cleanup(note that this command will clean up after more than just MySQL)
- Remove if present:
- Select the version that you want to install (in my case,
brew tap homebrew/versions
brew install mysql55
- Follow the post-install instructions as provided by the
- Add the appropriate directoy to your
Yours may differ from the below.
To have launchd start homebrew/versions/mysql55 at login: ln -sfv /usr/local/opt/mysql55/*.plist ~/Library/LaunchAgents Then to load homebrew/versions/mysql55 now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql55.plist Or, if you don't want/need launchctl, you can just run: /usr/local/opt/mysql55/bin/mysql.server start WARNING: launchctl will fail when run under tmux.