mysql .xb数据库备份恢复
备份文件先经过 qpress 压缩,后经过 xbstream 打包
1, 安装 xbstream
yum install percona-xtrabackup-24
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
这样就得到原如数据库文件了