xtrabackup备份与恢复

xtrabackup备份与恢复

全量备份
xtrabackup –backup –target-dir=/backup/full_backup –host=10.100.149.xxx –port=3306 –user=root –password=1
全量恢复
xtrabackup –copy-back –target-dir=/backup/Alldata

备份数据
innobackupex –host=10.100.149.xxx –user=root –password=1 /backup/allbak
innobackupex –apply-log /backup/allbak
innobackupex –defaults-file=/etc/mysql/my.cnf –copy-back /backup/allbak

使用全量备份文件执行全量还原
innobackupex –apply-log /backup/Alldata
innobackupex –defaults-file=/etc/mysql/my.cnf –copy-back /backup/Alldata

chown mysql:mysql -R /var/lib/mysql
重启数据库

使用全量备份文件和增量备份文件还原mysql到incre001时间点
innobackupex –apply-log –redo-only /backup/Alldata
innobackupex –apply-log –redo-only /backup/Alldata –incremental-dir=/backup/incre000
innobackupex –apply-log –redo-only /backup/Alldata –incremental-dir=/backup/incre001

chown mysql:mysql -R /var/lib/mysql
重启数据库

xtrabackup备份与恢复

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

Scroll to top
桂ICP备2023008908号-1