linux安装XtraBackup8

xtrabackup是percona团队研发的备份工具,比MySQL官方的ibbackup的功能还要多。支持myisam温全备、innodb热全备和温增备,还可以实现innodb的定时点恢复,而且备份和恢复的速度都较快。在目前MySQL的备份实现上,考虑价格、速度、安全、一致性等角度,xtrabackup是非常合适的工具。

MariaDB也可以使用percona xtrabackup进行备份,不过MariaDB基于percona xtrabackup开发了它自己的备份工具:MariaDB Backup。它基于xtrabackup开发,所以所用方法基本和xtrabackup相同,只是有些自己的特性

注意:XtraBackup只支持MySQL8.0,MySQL8.0以前的需要xtrabackup2.4备份和恢复

下载的rpm软件包安装Percona XtraBackup

> wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-8.0.4/binary/redhat/7/x86_64/percona-xtrabackup-80-8.0.4-1.el7.x86_64.rpm

常见错误

> rpm -ivh percona-xtrabackup-80-8.0.4-1.el7.x86_64.rpm
error: Failed dependencies:
        libev.so.4()(64bit) is needed by percona-xtrabackup-80-8.0.4-1.el7.x86_64
        perl(DBD::mysql) is needed by percona-xtrabackup-80-8.0.4-1.el7.x86_64
        perl(Digest::MD5) is needed by percona-xtrabackup-80-8.0.4-1.el7.x86_64

安装libev

> yum install  libev -y

安装DBD::mysql

> yum install perl-DBD-MySQL -y

安装Digest::MD5

> yum install -y perl-Digest-MD5

继续安装XtraBackup

> rpm -ivh rpm -ivh percona-xtrabackup-80-8.0.4-1.el7.x86_64.rpm

查看XtraBackup版本

> xtrabackup --version
xtrabackup: recognized server arguments: --datadir=/var/lib/mysql 
xtrabackup version 8.0.4 based on MySQL server 8.0.13 Linux (x86_64) (revision id: c2c0777)

卸载percona-xtrabackup

> yum remove `rpm -qa | grep percona-xtrabackup`

原文链接:https://rumenz.com/rumenbiji/...
微信公众号:入门小站

你可能感兴趣的