Xtrabackup backing up the MySQL database

Source: Internet
Author: User
Tags install perl

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.