XtraBackup数据库备份 安装和简单使用

环境基于centos7-1604-min,已经安装了MySQL5.6.28

1.安装
通过yum安装

yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
yum update
yum list | grep percona
yum install percona-xtrabackup-24

注意:centos5及其以下使用wget http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
rpm -ivH percona-release-0.1-3.noarch.rpm

通过rpm包安装

wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.6/binary/redhat/7/x86_64/Percona-XtraBackup-2.4.6-r54967d1-el7-x86_64-bundle.tar
tar -xvf Percona-XtraBackup-2.4.6-r54967d1-el7-x86_64-bundle.tar
 yum install percona-xtrabackup-24-2.4.6-1.el7.x86_64.rpm

2.测试
创建数据库备份文件夹

mkdir -p /home/mysql_bak/full
mkdir -p /home/mysql_bak/incre

执行数据库全备份

innobackupex --user=root --password=passoword /home/mysql_bak/full

备份完成后会在/home/mysql_bak/full生成一个文件夹2017-03-01_16-24-22

增量备份

innobackupex --user=root --password=passwrod --incremental --incrementa l-basedir=/home/mysql_bak/full/2017-03-01_16-24-22 /home/mysql_bak/truk

你可能感兴趣的:(XtraBackup数据库备份 安装和简单使用)