Last Updated: February 25, 2016
·
2.498K
· erebusbat

Move Homebrew MySql datadir

I just got two SSDs and want to put my databases on my 'data' drive.

Here is the general procedure I used:

brew install mysql
mysql_install_db --verbose --user=$USER --basedir=/usr/local/Cellar/mysql/5.6.12 --datadir="/Volumes/DataSSD/mysql" --tmpdir=/tmp

Then edit the mysql.server script (I don't use LaunchDaemons, ~line47:

datadir=/Volumes/DataSSD/mysql

Start up of the server should work great now!

mysql.server start