2、可能报错2
Can’t locate DBI.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/webserver/mysql5.1.57/bin/mysqlhotcopy line 25.
BEGIN failed–compilation aborted at /usr/local/webserver/mysql5.1.57/bin/mysqlhotcopy line 25.
报错原因:系统没有按安装DBI组件.
DBI(Database Interface)是perl连接数据库的接口.其是perl连接数据库的最优秀方法,他支持包括Orcal,Sybase,mysql,db2等绝大多数的数据库.
解决办法:
安装DBI组件(Can’t locate DBI.pm in @INC-mysql接口)
或者单独装DBI、Data-ShowTable、DBD-mysql 三个组件
[root@test-huanqiu percona-xtrabackup-2.1.9]# yum -y install perl-DBD-MySQL
接着使用innobackupex命令测试是否正常
[root@test-huanqiu percona-xtrabackup-2.1.9]# innobackupex –help
Options:
–apply-log
Prepare a backup in BACKUP-DIR by applying the transaction log file
named “xtrabackup_logfile” located in the same directory. Also,
create new transaction logs. The InnoDB configuration is read from
the file “backup-my.cnf”.
–compact
Create a compact backup with all secondary index pages omitted. This
option is passed directly to xtrabackup. See xtrabackup
documentation for details.
–compress
This option instructs xtrabackup to compress backup copies of InnoDB
data files. It is passed directly to the xtrabackup child process.
Try ‘xtrabackup –help’ for more details.
3、可能报错3
161130 05:56:48 innobackupex: Connecting to MySQL server with DSN ‘dbi:mysql:;mysql_read_default_file=/usr/local/mysql/my.cnf;mysql_read_default_group=xtrabackup’ as ‘root’ (using password: YES).
innobackupex: Error: Failed to connect to MySQL server as DBD::mysql module is not installed at /home/mysql/admin/bin/percona-xtrabackup-2.1.9/innobackupex line 2956.
解决办法:
[root@test-huanqiu ~]# yum -y install perl-DBD-MySQL.x86_64
……
Package perl-DBD-MySQL-4.013-3.el6.x86_64 already installed and latest version //发现本机已经安装了
[root@test-huanqiu ~]# rpm -qa|grep perl-DBD-MySQL
perl-DBD-MySQL-4.013-3.el6.x86_64
发现本机已经安装了最新版的perl-DBD-MYSQL了,但是仍然报出上面的错误!! 莫慌~~继续下面的操作进行问题的解决
查看mysql.so依赖的lib库
[root@test-huanqiu ~]# ldd /usr/lib64/perl5/auto/DBD/mysql/mysql.so
linux-vdso.so.1 => (0x00007ffd291fc000)
libmysqlclient.so.16 => not found //这一项为通过检查,缺失libmysqlclient.so.16库导致
libz.so.1 => /lib64/libz.so.1 (0x00007f78ff9de000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f78ff7a7000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f78ff58e000)
libm.so.6 => /lib64/libm.so.6 (0x00007f78ff309000)
libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f78ff09d000)
libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f78fecb9000)
libc.so.6 => /lib64/libc.so.6 (0x00007f78fe924000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007f78fe721000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f78fe4dd000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f78fe1f5000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f78fdff1000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f78fddc5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f78fdbc0000)
/lib64/ld-linux-x86-64.so.2 (0x00007f78ffe1d000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f78fd9b5000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f78fd7b2000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f78fd597000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f78fd37a000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f78fd15a000)
以上结果说明缺少libmysqlclient.so.16这个二进制包,找个官方原版的mysql的libmysqlclient.so.16替换了即可!
[root@test-huanqiu~]# find / -name libmysqlclient.so.16 //查看本机并没有libmysqlclient.so.16库文件
查看mysql/lib下的libmysqlclinet.so库文件
[root@test-huanqiu~]# ll /usr/local/mysql/lib/
total 234596
-rw-r–r–. 1 mysql mysql 19520800 Nov 29 12:27 libmysqlclient.a
lrwxrwxrwx. 1 mysql mysql 16 Nov 29 12:34 libmysqlclient_r.a -> libmysqlclient.a
lrwxrwxrwx. 1 mysql mysql 17 Nov 29 12:34 libmysqlclient_r.so -> libmysqlclient.so
lrwxrwxrwx. 1 mysql mysql 20 Nov 29 12:34 libmysqlclient_r.so.18 -> libmysqlclient.so.18
lrwxrwxrwx. 1 mysql mysql 24 Nov 29 12:34 libmysqlclient_r.so.18.1.0 -> libmysqlclient.so.18.1.0
lrwxrwxrwx. 1 mysql mysql 20 Nov 29 12:34 libmysqlclient.so -> libmysqlclient.so.18
lrwxrwxrwx. 1 mysql mysql 24 Nov 29 12:34 libmysqlclient.so.18 -> libmysqlclient.so.18.1.0
-rwxr-xr-x. 1 mysql mysql 8858235 Nov 29 12:27 libmysqlclient.so.18.1.0
-rw-r–r–. 1 mysql mysql 211822074 Nov 29 12:34 libmysqld.a
-rw-r–r–. 1 mysql mysql 14270 Nov 29 12:27 libmysqlservices.a
drwxr-xr-x. 3 mysql mysql 4096 Nov 29 12:34 plugin
将mysql/lib/libmysqlclient.so.18.1.0库文件拷贝到/lib64下,拷贝后命名为libmysqlclient.so.16
[root@test-huanqiu~]# cp /usr/local/mysql/lib/libmysqlclient.so.18.1.0 /lib64/libmysqlclient.so.16
[root@test-huanqiu~]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/mysql/lib/
/lib64/
[root@test-huanqiu~]# ldconfig
(编辑:ASP站长网)
|