初次使用Xtrabackup工具时遇到的一些坑,希望能帮助到各位。

1、安装xtrabackup报错,缺少依赖:
warning: percona-xtrabackup-2.3.6-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY error: Failed dependencies:     
libev.so.4()(64bit) is needed by percona-xtrabackup-2.3.6-1.el6.x86_64     
perl(DBD::mysql) is needed by percona-xtrabackup-

解决方法:
安装libev.so.4()库,配置好yum源,建议使用yum安装xtrabackup(使用yum安装,可以解决别的依赖)

libev.so包的下载链接:https://pan.baidu.com/s/1AJS5iox5SoHul0y5ubfK2Q 
提取码:iwd8

 

 

2、第一次备份数据库时报错:
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock','root',...) failed: Access denied for user 'root'@'localhost' (using password: YES) at - line 1314
200731 22:20:12 Connecting to MySQL server host: localhost, user: root, password: set, port: 0, socket: /var/lib/mysql/mysql.sock
Failed to connect to MySQL server: Access denied for user 'root'@'localhost' (using password: YES).

解决方法:报错原因是我给密码加了单引号(--password='密码'),结果导致账号密码错误,所以在备份时应该是--password=密码(直接输密码,不用加单引号)

 

 

3、备份时继续报错:
Error: Unsupported server version: '5.7.17-log'. Please report a bug at https://bugs.launchpad.net/percona-xtrabackup

解决方法:报错原因是我装的xtrabackup版本比mysql5.7要求版本低,所以根据官方版本要求重装xtrabackup

你可能感兴趣的:(初次使用Xtrabackup工具时遇到的一些坑,希望能帮助到各位。)