brew install mysql
Set up launchctl to auto start mysql
$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
/usr/local/opt/mysql/
is a symlink to /usr/local/Cellar/mysql/x.y.z
(e.g., 5.6.16
)
You can use launchctl to start and stop mysql
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
You can also more conveniently use brew
to start, stop, and verify service status
$ brew services list | grep mysql
$ brew services start mysql
$ brew services stop mysql
The mysql configuration is stored at /usr/local/opt/mysql/my.conf
.
For more about launchctl
see: