Mac OS X mySQL custom database path (MAMP PRO)

mikkelbreum picture mikkelbreum · Jan 20, 2011 · Viewed 10.5k times · Source

I'm using MAMP (OS-X 10.6.6) and I want to move my mySQL db folder to my dropbox folder. The MySQL server MAMP runs stores its databases in

/Library/Application Support/appsolute/MAMP PRO/db/mysql

..and I can't get it to follow symlinks or aliases to the mysql folder.

Is there a way to change the path mySQL uses for storing its databases? On the MAMP forum they say it's not possible, but I imagine there must be some kind of config file for whatever mySQL server it is that MAMP is running that can be changed to specify an alternative location for the used DBs..?

Anyone know how to acheive this? Storing the DB's on dropbox is the last element I need to solve to be able to work on my projects from my different computers.

Answer

mikkelbreum picture mikkelbreum · Jan 20, 2011

Just realized that its just the finder 'alias' type that won't work. creating a proper unix symlink works fine. so doing this solves the problem and keeps the databases on dropbox.

ln -s /Users/username/Dropbox/MAMP_db/mysql /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql