MySQL Mysql如何做增量备份
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4411057/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to do a incremental backup in Mysql
提问by Cybrix
Possible Duplicate:
What is the best way to do Incremental backups in Mysql?
可能的重复:
在 Mysql 中进行增量备份的最佳方法是什么?
Is there a way to do differentialincremental backup in MySQL ? I dont know if there is a PHP script or shell script able to do this.
有没有办法在 MySQL 中进行差异增量备份?我不知道是否有 PHP 脚本或 shell 脚本能够做到这一点。
I believe each tables states must be saved and their differences must be exported in the backup. Any way to accomplish this?
我相信必须保存每个表的状态,并且必须在备份中导出它们的差异。有什么办法可以做到这一点吗?
I know there are other types of backup but I like the way smallers backup are generated at time in differentialincremental backups.
我知道还有其他类型的备份,但我喜欢在差异增量备份中同时生成较小备份的方式。
Edit:
编辑:
I forgot to specify that my DB engine is InnoDB
我忘了指定我的数据库引擎是 InnoDB
采纳答案by ajreal
Yes, is called incremental backupinstead of differential backup
(correct me if I making wrong assumption)
是的,称为增量备份而不是差异备份
(如果我做出错误假设,请纠正我)
use binary log (replication sql log)
使用二进制日志(复制sql日志)
- http://dev.mysql.com/doc/refman/5.1/en/backup-methods.html
- http://dev.mysql.com/doc/refman/5.1/en/point-in-time-recovery.html
- http://dev.mysql.com/doc/refman/5.1/en/backup-methods.html
- http://dev.mysql.com/doc/refman/5.1/en/point-in-time-recovery.html
in nutshell, binary log contains list of write sql (insert,delete,update,alter table...) and execute these statement sequentially will provide a incremental update (which is what replication does)
简而言之,二进制日志包含写入 sql 的列表(插入、删除、更新、更改表...)并按顺序执行这些语句将提供增量更新(这就是复制所做的)