理想的 mysqldump 备份选项

发布于 2024-10-09 03:55:35 字数 344 浏览 0 评论 0原文

我正在为我们的数据库服务器创建一个备份脚本,并想询问是否有任何首选选项可以包含在 mysqldump 中。该脚本将每 6-24 小时从 cron 调用一次。

我们专门使用InnoDB。

我们的数据库相当大,我很可能会单独转储表簇,而不是一次性转储整个数据库。

现在,我正在考虑包括:

--opt # enabled by default
--quote-names # enabled by default
--single-transaction
--skip-comments

对于创建良好、可靠的转储文件还有其他建议或指示吗?

I'm creating a backup script for our database servers, and thought I'd ask if there are any preferred options to include with mysqldump. The script will be called from cron every 6-24 hours.

We use InnoDB exclusively.

Our databases are rather large, and I'll most likely dump clusters of tables individually, as opposed to the entire database in one go.

For now, I'm thinking of including:

--opt # enabled by default
--quote-names # enabled by default
--single-transaction
--skip-comments

Any other suggestions or pointers for creating good, reliable dump files?

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

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

发布评论

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

评论(1

反目相谮 2024-10-16 03:55:35

我建议你再设置一台带有 mysql 的服务器(从属服务器)并在那里复制数据(从主服务器、主服务器)。

如果您需要纯文本转储 - 您始终可以从从站执行此操作,而不会伤害主站。

I propose you to just set up one more server (slave) with mysql and replicate data there (from the main, master one).

If you'll need a plain text dump - you can always do it from the slave without hurting master.

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