mikkelbreum
mikkelbreum

Reputation: 3081

Mac OS X mySQL custom database path (MAMP PRO)

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.

Upvotes: 6

Views: 11284

Answers (2)

Lane
Lane

Reputation: 6742

mwb's method works. Remember, you also need to be be running Apache/MySQL server as user. Those settings are in MAMP PRO (Server -> General)

If you are going to be using dropbox to access the database on another machine, you will need to have identical paths to Dropbox as well.

Upvotes: 1

mikkelbreum
mikkelbreum

Reputation: 3081

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

Upvotes: 8

Related Questions