Mysql-xtrabackup Backup

Source: Internet
Author: User
Tags prepare

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

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.