Xtrabackup backing up the MySQL database
1. Installing dependent Packages
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/78/78/wKiom1Z9E7DhrU7MAAAnW21ULTQ385.png "title=" 9.png " alt= "Wkiom1z9e7dhru7maaanw21ultq385.png"/>
#yum-y Install Perl-time-hires-perl-dbd-mysql
Perl-dbd-mysql need mysql-libs-5.1.73 package, if this package and existing mysql-server conflict, need to install this package separately with RPM--force
2. Installing Xtrabackup
RPM-IVH percona-xtrabackup-2.2.11-1.el6.x86_64.rpm
3. Create a minimum rights backup user ( optional )
Create user backup ' @ ' localhost ' identified by ' zipeiyibackup ';
Revoke all privileges, grant option from ' Backup ';
Grant Reload,lock tables,replication Client on * * to ' backup ' @ ' localhist ';
Flush privileges;
4. Full backup
Innobackupex--user=root [email protected]? /mysqlbackup
5. Need to prepare log data before full backup recovery
Innobackupex--apply-log/mysqlbackup/2015-06-11_02-32-10/
6. Full backup to recover data, need to maintain DataDir folder is empty
innobackupex--copy-back/mysqlbackup/2015-06-11_02-32-10/
7. Incremental Backup
Innobackupex--user=root--incremental-basedir=/mysqlbackup/2015-06-12_11-15-43--incremental/mysqlbackup
each incremental backup --incremental-basedir needs to point to the path of the last backup (full or incremental)
8. Incremental backup Preparation
Prepare a full backup of the data first:
Innobackupex--user=root--apply-log--redo-only/mysqlbackup/ full backup path
Continue preparing for the second incremental backup data:
Innobackupex--user=root--apply-log--redo-only/mysqlbackup/ Full backup path --incremental-dir=/mysqlbackup/ Secondary incremental backup path
And so on
9. Incremental Backup Restore
Because incremental backup preparation has pooled the incremental backup data in a fully backed-up file
So the incremental backup is restored in the same way as a full backup
Innobackupex--copy-back/mysqlbackup/ Full backup path
After restore, you need to change the owner of the datadir to MySQL to start the service
Xtrabackup backing up the MySQL database