天天看点

Mysql备份XtraBackup工具安装

mysql配置文件添加:

innodb_file_per_table= 1   (这个至关重要!!!!*******每表单独的表空间)

InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.

xtrabackup: error: The transaction log file is corrupted.

xtrabackup: error: The log was not applied to the intended LSN!

xtrabackup: Log applied to lsn 3128344

xtrabackup: The intended lsn is 3129906

安装步骤:

1.下载地址

https://www.percona.com/downloads/XtraBackup/

2.准备安装 :

yum install perl-DBI

yum install perl-DBD-MySQL

yum install perl-Time-HiRes

yum install perl-IO-Socket-SSL

此处会出错:

A.问题

rpm -ivh perl-DBD-MySQL-4.013-3.el6.x86_64.rpm

warning: perl-DBD-MySQL-4.013-3.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY

error: Failed dependencies:

libmysqlclient.so.16()(64bit) is needed by perl-DBD-MySQL-4.013-3.el6.x86_64

libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by perl-DBD-MySQL-4.013-3.el6.x86_64

解决办法:

下载:

MySQL-shared-compat-5.5.43-1.linux2.6.x86_64.rpm 安装 rpm -ivh *****

B.问题

error: Failed dependencies:

libev.so.4 is needed by percona-xtrabackup-24-2.4.3-1.el6.i686

解决办法:

https://pkgs.org/centos-6/repoforge-i386/libev-4.15-1.el6.rf.i686.rpm.html下载文件安装

3.安装XtrabackUp

rpm -ivh percona-xtrabackup-2.1.5-680.rhel6.x86_64.rpm

4.查看版本

rpm -qa |grep xtrabackup 查看版本

rpm -e percona-xtrabackup-2.2.10-1.el6.i686 卸载