XtraBackup資料庫備份 安裝和簡單使用
阿新 • • 發佈:2019-01-02
環境基於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
通過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