My iMac disk space is also used up. Moved the mysql data file (/usr/local/mysql/data) to external hard drive (/Volumes/diskname/MysqlData/data)
- close mysql server
- sudo cp -R /usr/local/mysql/data /Volumes/diskname/MysqlData/.
- In /usr/local/mysql/my.cnf, add “datadir = /Volumes/diskname/MysqlData/data”
- restart mysql server
The drawback is there will be no TimeMachine backup for this database…
update 1: It seems I can make an alias for the /Volumes/diskname/MysqlData/data and drag the alias into my iMac disk. The timemachine will backup this directory.
update 2: Another way to backup directory on external HDD is to remove the directory on TM’s exclusion list. I will use this method for now.