There are several ways to install MySQL on your Mac, for example:
- compile from source
- use the Homebrew package manager (http://brew.sh)
- use a nifty script courtesy of Mac Mini Vault (http://git.io/eUx7rg)
- or use the dedicated MySQL installer package (recommended)
I recommend the dedicated installer because it’s the only package that will also add a convenient Preference Pane for starting and stopping the service.
In this article I’ll focus on the latter, and I’ll also talk you through how to add MySQL to the PATH variable and how to secure MySQL to keep the evildoers away from your server.
These instructions will work on Yosemite and El Capitan (I’ve tested it on both systems – in fact that’s part of why I’m writing this, so that I can remember for next time).