Use Xtrabackup to make incremental backups of data
Third-party software percona-xtrabackup-*.rpm
1 Online backup (does not lock the table when backing up)
XTRABACKUP:C programs, tables that support the INNDB/XTRADB storage engine
Innobackupex: Xtrabackup is encapsulated in Perl scripts and also supports tables MyISAM the storage engine
Install dependent package Perl-time-hires requires Yum pack dependency
XTRABACKUP_56 option (incremental backup, incremental restore, 56 for version)
You must have a full backup first, since only a full backup will know what data is newly generated when you back up the data, back up only the data in the table, backup the table structure (if the table does not exist, the backup file that uses it cannot recover the data)
Common options:
--backup Backing up data
--datadir= database Directory specified database directory
--target-dir= Directory name specifies where the backup file is stored
--incremental-basedir= Directory Name Incremental backup, specify the directory where the last backup file was stored
--incremental-dir= directory name when preparing to restore data, specify the directory where the incremental backup file is stored
--prepare Preparing to recover data
Backup data:
First full backup [[email protected] packages]# xtrabackup_56--backup--datadir=/ar/lib/mysql--target-dir=/haha
Second incremental backup [[email protected] packages]# xtrabackup_56--backup--datadir=/var/lib/mysql--incremental-basedir=/haha-- Target-dir=/hahanew1
Third incremental backup [[email protected] packages]# xtrabackup_56--backup--datadir=/var/lib/mysql--incremental-basedir=/hahanew1 --target-dir=/hahanew2
Recovering data using the XTRABACKUP_56 command
1 Preparing to recover data
xtrabackup_56--prepare--datadir=/var/lib/mysal--target-dir=/haha
xtrabackup_56--prepare--datadir=/var/lib/mysal--target-dir=/haha--incremental-dir=/hahanew1
xtrabackup_56--prepare--datadir=/var/lib/mysal--target-dir=/haha--incremental-dir=/hahanew2
2 Copy the backup files to the database directory
cp/haha/table name/table name. ibd/var/lib/mysql/Table Name
Restart MySQL Service
This article is from "Linux Cloud Computing" blog, reprint please contact the author!
Mysql-xtrabackup Backup