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
继续阅读
评论