Xtrabackup Backup Restore MySQL Database

Source: Internet
Author: User
Tags percona

Download Xtrabackup:

# wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.6/binary/tarball/ Percona-xtrabackup-2.4.6-linux-x86_64.tar.gz

Decompression Software:

# tar xvf percona-xtrabackup-2.4.6-linux-x86_64.tar.gz-c/usr/local/

# cd/usr/local/

# MV Percona-xtrabackup-2.4.6-linux-x86_64/xtrabackup

Set Environment variables:

# echo "Export path=/usr/local/xtrabackup/bin:\ $PATH" >>/etc/profile

# Source/etc/profile

To install a dependency package:

Yum Install-y perl-digest-md5

Fully-prepared database:

[Email protected] ~]$ Innobackupex--defaults-file=/etc/my.cnf--user=root--password=centos--socket=/var/lib/mysql /mysql.sock/mysqlbk

Incremental BACKUP DATABASE:

[Email protected] ~]$ Innobackupex--defaults-file=/etc/my.cnf--user=root--password=centos--socket=/var/lib/mysql /mysql.sock--incremental--incremental-basedir=/mysqlbk/2017-03-26_21-56-46/mysqlbk_rec

Fully prepared for recovery:

[Email protected] ~]$ Innobackupex--defautls-file=/mysqlbk/my.cnf--apply-log--redo-only/mysqlbk/2017-03-26_ 21-56-46

Incremental Recovery Preparation:

[Email protected] ~]$ Innobackupex--defaults-fil=/mysqlbk/my.cnf--apply-log/mysqlbk/2017-03-26_21-56-46-- Incremental-dir=/mysqlbk_rec/2017-03-26_21-57-11

Perform Innobackupex--apply-log:

[Email protected] ~]$ Innobackupex--defautls-file=/mysqlbk/my.cnf--apply-log/mysqlbk/2017-03-26_21-56-46

Perform recovery:

[Email protected] ~]$ Innobackupex--defaults-file=/mysqlbk/my.cnf--socket=/var/lib/mysql/mysql.sock--copy-back/ mysqlbk/2017-03-26_21-56-46

To compress a backup set:

[Email protected] ~]$ Innobackupex--defaults-file=/usr/local/mysql/my.cnf--user=root--password=centos--socket=/ Tmp/mysql.sock--stream=tar/tmp | Gzip->/mysqlbk/mysql_fullbackup.tar.gz

This article is from the "high-tech blog" blog, please be sure to keep this source http://gpj1997.blog.51cto.com/12830710/1940979

Xtrabackup Backup Restore 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.