关于mysql增量备份

求助:

mysql的增量备份的shell

我的环境:
redhat es3.0

mysql4.1

希望可以写一个shell可以实现每天增量备份,每月全部数据备份一次

谢谢

Taxonomy upgrade extras:

如果直接对mysql的数据表进行增量备份目前似乎还没办法,至少是需要跟应用程序相关联的,不可取。
一个变通的办法是启用binlog(二进制日志),然后每天刷新一下,产生新的binlog,把旧的日志备份起来,就相当于增量备份了。

欢迎来到MySQL中文网: http://imysql.cn

给你的祝福,要让你招架不住!

哈哈“给你的祝福,要让你招架不住!”说的好!
—— Zandy , http://www.tetx.com

使用binlog+gzip备份,然后rsync同步到备份服务器,是个不错的方法。
________________________________________
爱旅游网

mysql 5.0 的手册上是这样写的。
Using the Binary Log to Enable Incremental Backups

MySQL supports incremental backups: You must start the server with the --log-bin option to enable binary logging; see Section 5.2.3, “The Binary Log”. The binary log files provide you with the information you need to replicate changes to the database that are made subsequent to the point at which you performed a backup. At the moment you want to make an incremental backup (containing all changes that happened since the last full or incremental backup), you should rotate the binary log by using FLUSH LOGS. This done, you need to copy to the backup location all binary logs which range from the one of the moment of the last full or incremental backup to the last but one. These binary logs are the incremental backup; at restore time, you apply them as explained in Section 6.3, “Point-in-Time Recovery”. The next time you do a full backup, you should also rotate the binary log using FLUSH LOGS, mysqldump --flush-logs, or mysqlhotcopy --flushlog. See Section 4.5.4, “mysqldump — A Database Backup Program”, and Section 4.6.8, “mysqlhotcopy — A Database Backup Program”.