将 MySQL 连接到 Dropbox

发布于 2024-11-07 03:37:30 字数 322 浏览 0 评论 0原文

我已成功更改我的 httpd.conf 文件,以便将 DocumentRoot 修改为我的 Dropbox 文件夹。 localhost 不再指向 /etc/www,而是 /home/Dropbox/www...

这很方便,因为无论我在哪台计算机上,对我的 Web 文件的更改都会同步,并且 Dropbox 保持透明的版本控制系统在后台。

我想知道是否也可以将 mySQL 数据(不一定是实际的二进制文件)存储在我的 Dropbox 文件夹中。如果可能的话,数据同步将同样有用。人们需要进行什么样的更改才能将数据库、表格和其他用户生成的内容推送到 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

三生殊途 2024-11-14 03:37:30

使用远程 mysql 数据库可能更容易、更可靠。大多数网络主机都提供 mysql 服务,有些甚至是免费的。同步 mysql 数据库是一件痛苦的事,无论你怎么做!如果您开始复制数据文件本身,它只是在等待损坏!

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!

眼眸 2024-11-14 03:37:30

如果您成功复制 MySQL 的数据文件夹并将其指向那里,这是可能的,但是您可能会遇到并发问题。这不是推荐的方法。为什么不使用版本控制系统,例如 svn、git 以及允许远程连接的 MySQL 服务器呢?

数据库更新非常频繁,Dropbox 会强制其更新过于频繁,但有时会无法同步,并且 DropBox 更新会浪费您的连接。这确实不是一个好的做法。

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.

玩套路吗 2024-11-14 03:37:30

当然可以,编辑 my.cnf 文件并将 datadir 从原来的位置(可能是 /var/lib/mysql/)更改为 <代码>/home/Dropbox/mysql...

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

維他命╮ 2024-11-14 03:37:30

Dropbox 无法处理文件所有权(和权限),因此如果您的原始数据库文件由 mysql:mysql 所有,则每次同步后所有者将是 youruser:yourgroup,权限设置为 664 并且数据库对于 mysql 将是只读的!

解决方案是将用户 mysql 添加到组 yourgroup 中,然后它以 664 权限工作,并且您不必每次都手动将所有权更改回 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文