Sharing MySQL Databases With Dropbox Is Easier Than You Think!

Dropbox is very extensive, and you can make a lot more things like placing documents or holiday pictures in your Dropbox folders. Here I will explain shortly how you share your MySQL Databases with a Dropbox client with multiple systems on Windows with XAMPP. But remember, my way may differ from your system/installation!

Why would you do something like that?

If you have more than one workplace and not always a stable internet connection to use an online database (service provider?!), my solution works very well.

The Configuration

First, we have to stop the database server. Otherwise we can’t move any folder which contains the database folder and files. If the MySQL server has stopped, we move the database data from the directory (C:xamppmysqldata) to the Dropbox folder where we want to place the data. For example, I’m using C:/Users/anonymous/Dropbox/mysql-databases/ for my MySQL databases because my Dropbox folder is located under. C:/Users/anonymous/Dropbox/ If it’s done, we have to adjust the my.ini which is located under:C:xamppmysqlbin

// my.ini
datadir = "C:/xampp/mysql/data"
to
datadir = "C:/Users/anonymous/Dropbox/mysql-databases"
...
pid_file = "mysql.pid"
to
pid_file = "C:/xampp/mysql/mysql.pid"

Are we done with our adjustments, we start the MySQL server and look at the C:/Users/anonymous/Dropbox/mysql-databases/ folder. The MySQL server process should create a whole bunch of necessary files like this (If they don’t even exist yet!):

auto.cnf
ib_logfile0
ib_logfile1
ibdata1

Now we finish an be able to use the MySQL databases as usual. If we start the MySQL server on other systems, the files above will be updated if it’s necessary.

One thing you should keep in mind: If you have databases with a lot of huge table entries, it’s recommended to pause the dropbox syncing while working with the databases. Otherwise every change on your database tables will synchronize and if your database tables are larger than a few of megabytes, that will suck your bandwith and maybe your system resources! The other thing is to use the same version of the mysql database server on each system. Otherwise, maybe problems can arise.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn