MySQL - 如何将数据库备份到不同的服务器?

发布于 2024-09-18 18:04:30 字数 252 浏览 11 评论 0原文

我有 2 个带有 MyISAM 表的数据库,每周更新一次。它们的大小相当大(一个 DB 为 2GB,另一个为 6GB)。目前,我每周使用 mysqldump 备份一次,并将最后 2 周的 .sql 转储保留在运行数据库的同一服务器上。

但是,我希望能够将备份转储到另一台服务器,因为它们不必要地占用了服务器空间。实现这一目标的最佳方法是什么?如果可能的话,我希望在备份期间保持数据库运行。 (备份过程中不会发生任何插入或更新,仅进行选择)。

提前致谢, 蒂姆

I have 2 databases with MyISAM tables which are updated once a week. They are quite big in size (one DB is 2GB and the other is 6GB). I currently back them up once a week with mysqldump and keep the last 2 weeks' worth of .sql dumps on the same server where the DBs are running.

I would like, however, to be able to dump the backups to another server, as they are taking up server space unnecessarily. What is the best way to achieve this? If possible, I would like to keep the databases running during the backup. (no inserts or updates take place during the backup process, just selects).

Thanks in advance,
Tim

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

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

发布评论

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

评论(1

回梦 2024-09-25 18:04:30

如果我是你,我会创建一个脚本来执行备份,然后将备份发送到其他地方。我知道这就是您所问的问题,但您遗漏了一些值得了解的事情,例如您的两个系统正在运行什么操作系统?

它们都是 Windows,您可以安装网络驱动器并在那里进行备份转储(或将转储复制到那里)。如果它们是 Linux 服务器,我建议使用 scp 命令复制它。如果它是混合的,那么它就会变得有趣和棘手。

如果您使用 Linux 服务器,以下指南将引导您完成备份过程。 点击我!

如果您仍在抓挠读完后你的头脑,让我知道你正在使用什么样的操作系统,我可以提供更详细的说明。

祝你好运!

Were I you, I would create a script that did the backup and then sent the backup elsewhere. I know that is kind of what you are asking how to so, but you left out some things that would be good to know, such as what OS are your two systems running?

Of they are both windows, you could mount a network drive and have the backup dump there (or copy the dump there). If they are linux servers I would recommend copying it across using the scp command. If it is a mix then it gets fun and tricky.

If you are working with linux servers, the following guide should walk you through the process of backup. Click me!

If you are still scratching your head after reading that, let me know what kind of OSes you are rolling with and I can provide more detailed instructions.

Good luck!

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