Sync MAMP MySQL Database Using Dropbox

This is a great way for developers who tend to work on several different machines to sync their local development environments. Notice! This is not a recommended configuration for mysql, and can result in some problems involving locks on files etc.. if you really want to sync a db for production purposes or more robustly use mysql replication. That being said, I’ve been running this configuration for a while and haven’t run into any serious problems. Just make sure you only have one instance of MAMP running at a time!

Here’s how it’s done using your terminal: (only 2 steps!)

1) Move your MAMP mysql folder into your Dropbox

 mv /Applications/MAMP/db/mysql ~/Dropbox/

2) Create a symbolic link (a shortcut) from the old location to the new one (create it in the /Applications/MAMP/db/mysql folder)

ln -s ~/Dropbox/mysql mysql

To confirm that you did things correctly:

run ls -l and you should see this: mysql -> /Users/kevinsloan2/Dropbox/mysql

If you’re not using Dropbox yet — you’re missing out! It’s such a wonderful tool that makes working across several machines seamless, sign up here!

4 thoughts on “Sync MAMP MySQL Database Using Dropbox

  1. Dean Reply


    Interesting post. I’m not a website designer, but I do run a fairly large MySQL database on my Mac. I’ve been trying to move the MySQL database into Dropbox, to allow me to ‘access’ it from different machines. This has run into permission problems that I can’t solve.

    Your post has suggested moving the entire MySQL application into Dropbox. Does that really work? If I had installed MySQL on a different machine, I suppose I delete the directory, and then establish the link?

    Any help appreciated.


    • Kevin Sloan Post authorReply

      So we’re not actually moving the mysql application, just the mysql database that MAMP is using. Then, since MAMP is expecting that folder to be in it’s own Application folder, we just need to sim-link from the old location to the new one. I edited the post to make it a little more clear.

      Our mysql application hasn’t moved at all:

      Kevins-MacBook-Pro:MAMP kevin$ which mysql

      In theory, this should work with a regular mysql database as well… to see where you mysql db is stored run this command:

      SELECT @@datadir, @@innodb_data_home_dir;

      I haven’t tried it but you should be able to pull the same trick by moving that folder out to your dropbox and sim-linking from the old location to the new one. If you try it please let me know how it goes!! 🙂

  2. Chase Reply

    Thank you for this article. I am having a slight issue with the mysql folder. I set this up initially on my Mac Pro and then set it up on my Macbook Pro. The Macbook Pro seems to be having an issue reading the database file. When inside phpMyAdmin I can see the Database, it lists the tables you typically see but in the structure tab it says “no tables found in database”. Any ideas. Dropbox seems to be creating conflicted files which I’m sure is the cause. Just not sure how I resolve that. Any thoughts are appreciated.

    • Kevin Sloan Post authorReply

      Were you running both instances at the same time? That’s the only time I’ve run into trouble. If not, I don’t know what could have caused that. Sorry :/

Leave a Reply

Your email address will not be published. Required fields are marked *