xtrabackup备份执行报错一例

来源:互联网 发布:高松好玩吗 知乎 编辑:程序博客网 时间:2024/06/04 18:27


一、问题描述
在用xtrabackup在线完全备份mysql时报错:
[mysql@mvxl0782 ~]$ innobackupex --defaults-file=/data/mysql/mysql3376/my3376.cnf --user=xtrabk --password='onlybackup' /data/backup/

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p

160517 15:57:43  innobackupex: Connecting to MySQL server with DSN

'dbi:mysql:;mysql_read_default_file=/data/mysql/mysql3376/data/my3376.cnf;mysql_read_default_group=xtrabackup' as 'xtrabk'  (using password: YES).
innobackupex: got a fatal error with the following stacktrace: at /usr/local/percona-xtrabackup-2.2.9-Linux-x86_64/bin/innobackupex line 2999
        main::mysql_connect('abort_on_error', 1) called at /usr/local/percona-xtrabackup-2.2.9-Linux-x86_64/bin/innobackupex line 1539
innobackupex: Error: Failed to connect to MySQL server as DBD::mysql module is not installed at /usr/local/percona-xtrabackup-2.2.9-Linux-x86_64/bin/innobackupex line

2999.

二、问题分析
  从上面明显看到DBD没有安装。

三、问题解决:
[root@mvxl0782 local]# yum install perl-DBD-MySQL
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
rhel6                                                                                                        | 4.0 kB     00:00    
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.61-4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                             Arch                        Version                           Repository                  Size
====================================================================================================================================
Installing:
 perl-DBD-MySQL                      x86_64                      4.013-3.el6                       rhel6                      134 k
Installing for dependencies:
 mysql-libs                          x86_64                      5.1.61-4.el6                      rhel6                      1.2 M

Transaction Summary
====================================================================================================================================
Install       2 Package(s)

Total download size: 1.4 M
Installed size: 4.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): mysql-libs-5.1.61-4.el6.x86_64.rpm                                                                    | 1.2 MB     00:00    
(2/2): perl-DBD-MySQL-4.013-3.el6.x86_64.rpm                                                                 | 134 kB     00:00    
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                13 MB/s | 1.4 MB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mysql-libs-5.1.61-4.el6.x86_64                                                                                   1/2
warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
  Installing : perl-DBD-MySQL-4.013-3.el6.x86_64                                                                                2/2
Installed products updated.
  Verifying  : perl-DBD-MySQL-4.013-3.el6.x86_64                                                                                1/2
  Verifying  : mysql-libs-5.1.61-4.el6.x86_64                                                                                   2/2

Installed:
  perl-DBD-MySQL.x86_64 0:4.013-3.el6                                                                                              

Dependency Installed:
  mysql-libs.x86_64 0:5.1.61-4.el6                                                                                                 

Complete!

再执行备份成功
[mysql@mvxl0782 ~]$ innobackupex --defaults-file=/data/mysql/mysql3376/my3376.cnf --user=xtrabk --password='onlybackup' --slave-info /data/backup/

0 0
原创粉丝点击