开发者

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 b开发者_如何学运维ackground.

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?


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!


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜