XtraBackup,在使用innobackupex 中出现了错误: perl-DBD-MySQL 无法安装

来源:互联网 发布:网络舆情分析系统 编辑:程序博客网 时间:2024/04/27 06:02

注:部分内容转载

问题描述:

在使用innobackupex 中出现了错误
 

-bash-4.1$ innobackupex --defaults-file=./my_3304.cnf --user=xtrabk --password='xtrabk' --socket=./mysql3304.sock /data/mysql/mysql3304/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

 

150510 16:07:50  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=./my_3304.cnf;mysql_read_default_group=xtrabackup;mysql_socket=./mysql3304.sock' as 'xtrabk'  (using password: YES).

innobackupex: got a fatal error with the following stacktrace: at /data/mysql/tool/percona-xtrabackup-2.2.10-Linux-x86_64/bin/innobackupex line 2998

        main::mysql_connect('abort_on_error', 1) called at /data/mysql/tool/percona-xtrabackup-2.2.10-Linux-x86_64/bin/innobackupex line 1539

innobackupex: Error: Failed to connect to MySQL server as DBD::mysql module is not installed at /data/mysql/tool/percona-xtrabackup-2.2.10-Linux-x86_64/bin/innobackupex line 2998.
 

准备安装 

yum install perl-DBI

yum install perl-DBD-MySQL

yum install perl-Time-HiRes

yum install perl-IO-Socket-SSL



问题现象1:

[root@centos1 Packages]# 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


问题现象2

[root@centos1 etc]# yum install perl-DBD-MySQL
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
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: perl(DBI::Const::GetInfoType) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Processing Dependency: perl(DBI) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> 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.71-1.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-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                       c6-media                     134 k
Installing for dependencies:
 mysql-libs                         x86_64                     5.1.71-1.el6                      c6-media                     1.2 M
 perl-DBI                           x86_64                     1.609-4.el6                       c6-media                     705 k

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

Total download size: 2.0 M
Installed size: 6.0 M
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                97 MB/s | 2.0 MB     00:00     
Running rpm_check_debug
Running Transaction Test


Transaction Check Error:
  file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL-server-5.6.17-1.el6.x86_64
  file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL-server-5.6.17-1.el6.x86_64
  file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL-server-5.6.17-1.el6.x86_64
  file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL-server-5.6.17-1.el6.x86_64
  file /usr/share/mysql/charsets/cp1256.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL-server-5.6.17-1.el6.x86_64
  file /usr/share/mysql/charsets/cp1257.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL-server-5.6.17-1.el6.x86_64
  file /usr/share/mysql/charsets/cp850.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL-server-5.6.17-1.el6.x86_64
  file /usr/share/mysql/charsets/cp852.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL-server-5.6.17-1.el6.x86_64


解决办法:
下载:
MySQL-shared-compat-5.5.43-1.linux2.6.x86_64.rpm   

[root@centos1 tool]# rpm -ivh MySQL-shared-compat-5.5.43-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-shared-compat    ########################################### [100%]
[root@centos1 tool]# yum install perl-DBD-MySQL
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                            Arch                       Version                           Repository                    Size
====================================================================================================================================
Installing:
 perl-DBD-MySQL                     x86_64                     4.013-3.el6                       c6-media                     134 k

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

Total download size: 134 k
Installed size: 338 k
Is this ok [y/N]: y

Downloading Packages:
http://ftp.sjtu.edu.cn/centos/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.
http://mirror.neu.edu.cn/centos/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.
http://mirrors.163.com/centos/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.
http://mirrors.aliyun.com/centos/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.
http://mirrors.cqu.edu.cn/CentOS/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.
http://mirrors.nwsuaf.edu.cn/centos/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.
http://mirrors.opencas.cn/centos/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.
http://mirrors.pubyun.com/centos/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.
http://mirrors.sina.cn/centos/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.
http://mirrors.skyshe.cn/centos/5.11/os/x86_64/CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm: [Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Trying other mirror.


Error Downloading Packages:
  perl-DBD-MySQL-3.0007-2.el5.x86_64: failure: CentOS/perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm from base: [Errno 256] No more mirrors to try. 

还有有问题, 执行yum clean all 清除缓存目录下的软件包及旧的headers;
接着发现yum不能用,估计是dns的问题,解决方法如下:
echo "nameserver 8.8.8.8" >> /etc/resolv.conf 

继续安装
 [root@localhost tmp]# yum install perl-DBD-MySQL
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=x86_64&repo=addons error was
[Errno 4] IOError: <urlopen error (-3, '\xd3\xf2\xc3\xfb\xbd\xe2\xce\xf6\xd4\xdd\xca\xb1\xca\xa7\xb0\xdc')>
Error: Cannot find a valid baseurl for repo: addons
[root@localhost tmp]# echo "nameserver 8.8.8.8" >> /etc/resolv.conf
[root@localhost tmp]# 
[root@localhost tmp]# yum install perl-DBD-MySQL
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: mirrors.btte.net
 * base: mirrors.yun-idc.com
 * extras: mirrors.yun-idc.com
 * updates: mirrors.aliyun.com
addons                                                                                                                        | 1.9 kB     00:00     
addons/primary_db                                                                                                             | 1.1 kB     00:00     
base                                                                                                                          | 1.1 kB     00:00     
base/primary                                                                                                                  | 1.3 MB     00:02     
base                                                                                                                                       3667/3667
extras                                                                                                                        | 2.1 kB     00:00     
extras/primary_db                                                                                                             | 173 kB     00:00     
updates                                                                                                                       | 1.9 kB     00:00     
updates/primary_db                                                                                                            | 368 kB     00:02     
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================
 Package                                 Arch                            Version                                 Repository                     Size
=====================================================================================================================================================
Installing:
 perl-DBD-MySQL                          x86_64                          3.0007-2.el5                            base                          148 k

Transaction Summary
=====================================================================================================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 148 k
Is this ok [y/N]: y
Downloading Packages:
perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm                                                                                        | 148 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl-DBD-MySQL                                                                                                                1/1 

Installed:
  perl-DBD-MySQL.x86_64 0:3.0007-2.el5                                                                                                               

Complete! 


搞定

0 0