Jordan Arsenault
Jordan Arsenault

Reputation: 7408

Connecting MySQL to Dropbox

I've successfully made changes to my httpd.conf file in order to modify the DocumentRoot to my Dropbox folder. No longer does localhost point to /etc/www, but rather /home/Dropbox/www...

This is convenient because no matter which computer I'm on, the changes to my web files are synchronized, and Dropbox keeps a transparent versioning system in the background.

I'm wondering if it is also possible to store mySQL data (not necessarily the actual binaries) in my Dropbox folder. Data synchronization would be equivalently useful if this were possible. What kind of changes would one make to have databases, tables, and other user generated content pushed off to a Dropbox folder, rather than my local hard drive?

Upvotes: 10

Views: 12160

Answers (4)

ahmet alp balkan
ahmet alp balkan

Reputation: 45252

It is possible if you successfully can copy data folder of MySQL and point it to right there however you may encounter problems with the concurrency. That's not a recommended way. Why don't you use a version control system such as svn, git with a remote connections allowed MySQL server?

Databases get updated very frequently and dropbox will force it to update too frequently, but it will fail to sync sometimes and your connection will be wasted with DropBox updates. That's really not a good practice.

Upvotes: 2

bartusdavid
bartusdavid

Reputation: 1

Dropbox cannot handle file ownerships (and permissions), so if your original database file was owned by mysql:mysql, after every sync the owner would be youruser:yourgroup, the permissions set to 664 and the database would be read-only for mysql!

The solution is to add the user mysql to the group yourgroup, and then it works with 664 permissions and you don't have to manually change the ownerships back to mysql every time.

Upvotes: 0

gnur
gnur

Reputation: 4733

It is probably easier, and more reliable, to use a remote mysql database. Most web hosts offer mysql services, some even are free. Syncing mysql databases is a pain, no matter how you do it! If you start copying the data files themselves it is just waiting for corruption!

Upvotes: 10

Pål Brattberg
Pål Brattberg

Reputation: 4698

Sure you can, edit your my.cnf file and change datadir from what is was (perhaps /var/lib/mysql/) to /home/Dropbox/mysql...

Upvotes: 1

Related Questions