理想的 mysqldump 备份选项
我正在为我们的数据库服务器创建一个备份脚本,并想询问是否有任何首选选项可以包含在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议你再设置一台带有 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.