innobackupex: Error: Failed to connect to MySQL server as DBD::mysql module is not installed

   innobackupex同时支持备份innodb和MyISAM(会加一个全局的读锁)。

[mysql@gdsDB bin]$ ./innobackupex --user=root --password= --socket=/oradata/MC/mysqldata/3308/mysql.sock --defaults-file=/oradata/MC/mysqldata/3308/my.cnf /oradata/MC/mysqldata/backup --no-timestamp

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

170323 09:00:05  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/oradata/MC/mysqldata/3308/my.cnf;mysql_read_default_group=xtrabackup;mysql_socket=/oradata/MC/mysqldata/3308/mysql.sock' as 'root'  (using password: NO).
innobackupex: Error: Failed to connect to MySQL server as DBD::mysql module is not installed at ./innobackupex line 2976.
[mysql@gdsDB bin]$ ./innobackupex --user=root --password= --socket=/oradata/MC/mysqldata/3308/mysql.sock --defaults-file=/oradata/MC/mysqldata/3308/my.cnf /oradata/MC/mysqldata/backup --no-timestamp

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

170323 09:00:45  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/oradata/MC/mysqldata/3308/my.cnf;mysql_read_default_group=xtrabackup;mysql_socket=/oradata/MC/mysqldata/3308/mysql.sock' as 'root'  (using password: NO).
innobackupex: Error: Failed to connect to MySQL server as DBD::mysql module is not installed at ./innobackupex line 2976.

根据操作系统的版本安装合适的perl-DBD-MySQL,因为innobackupex是一个封装了xtrabackup的perl脚本。
[root@gdsDB MC]# 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
Preparing...                ########################################### [100%]
   1:perl-DBD-MySQL         ########################################### [100%]
   
[mysql@gdsDB bin]$ ./innobackupex --user=root --password= --socket=/oradata/MC/mysqldata/3308/mysql.sock --defaults-file=/oradata/MC/mysqldata/3308/my.cnf /oradata/MC/mysqldata/backup --no-timestamp
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

170323 09:07:26  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/oradata/MC/mysqldata/3308/my.cnf;mysql_read_default_group=xtrabackup;mysql_socket=/oradata/MC/mysqldata/3308/mysql.sock' as 'root'  (using password: NO).
170323 09:07:26  innobackupex: Connected to MySQL server
170323 09:07:26  innobackupex: Executing a version check against the server...
170323 09:07:26  innobackupex: Done.
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".
innobackupex: Using mysql server version 5.6.25-log
sh: xtrabackup_56: command not found

innobackupex: Error: no 'mysqld' group in MySQL options at ./innobackupex line 4377.

把环境变量加上去即可

[mysql@gdsDB bin]$ export PATH=/oradata/MC/mysqldata/percona-xtrabackup-2.1.7-Linux-x86_64/bin:$PATH

再次执行命令成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值