mysql .xb 数据库备份恢复

猫哥 程序代码评论字数 1090阅读3分38秒阅读模式

mysql .xb数据库备份恢复
https://cloud.tencent.com/document/product/236/33362

备份文件先经过 qpress 压缩,后经过 xbstream 打包

1, 安装 xbstream
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
yum install percona-xtrabackup-24

报错:
https://blog.csdn.net/xinjing2015/article/details/88178789

The GPG keys listed for the "Percona-Release YUM repository - x86_64" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.


 Failing package is: Percona-Server-client-56-5.6.43-rel84.3.el7.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Percona

解决:yum update percona-release

然后再执行一遍步骤1

2,安装qpress

yum -y install qpress

3执行以下命令就可以得到数据表了。(backup.xb是我的‘.xb’文件名,/root/data为文件所在路径)

xbstream -x -C /root/data < ~/backup.xb

4.使用 qpress 命令将目标目录下所有以.qp结尾的文件都解压出来

xtrabackup --decompress --target-dir=/root/data

5.备份解压出来之后,需要执行以下命令进行 apply log 操作

xtrabackup --prepare  --target-dir=/root/data

这样就得到原如数据库文件了

其它可以参考以下链接

https://cloud.tencent.com/document/product/236/33363#.E5.90.AF.E5.8A.A8-mysqld-.E8.BF.9B.E7.A8.8B.E5.B9.B6.E7.99.BB.E5.BD.95.E9.AA.8C.E8.AF.81

继续阅读
猫哥
  • 本文由 发表于 2021-03-29 10:33:58
  • 转载请务必保留本文链接:https://www.588693.com/1213.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定