a question about innobackupex

[root@localhost subsys]# innobackupex --user=root --password=root /usr/local/webserver/percona-xtrabackup-2.1.3/dbbackpupath/

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Ireland Ltd 2009-2012. All Rights Reserved.

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

130613 02:58:20 innobackupex: Connecting to MySQL server with DSN ‘dbi:mysql:;mysql_read_default_group=xtrabackup’ as ‘root’ (using password: YES).
ERROR: Failed to connect to MySQL server as DBD::mysql module is not installed at /usr/local/webserver/mysql/bin/innobackupex line 1397.

what means, the progrom mysql and innobackupex should be same directory ? I do it ,the same result

The error means you are missing the Perl DBI driver for the MySQL database. You need to install it first.
shell$ yum install perl-DBD-MySQL

I’m running into the same issue. I’m on debian wheezy. libdbd-perl is installed.

aptitude search libdbd|grep mysql

i libdbd-mysql - MySQL database server driver for libdbi
i libdbd-mysql-perl - Perl5 database interface to the MySQL data

yet I still get the same error as Edward:

innobackupex /var/lib/mysql/backup

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Ireland Ltd 2009-2012. All Rights Reserved.

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

130617 14:15:42 innobackupex: Connecting to MySQL server with DSN ‘dbi:mysql:;mysql_read_default_group=xtrabackup’ (using password: NO).
ERROR: Failed to connect to MySQL server as DBD::mysql module is not installed at /usr/bin/innobackupex line 1397.

Anyone have a clue?

Thanks.

can you please send me the output of:

mysql --version
uname -a
cat /etc/*release
aptitude show libdbd-mysql-perl

Is this percona server or oracle mysql?
This info could be useful in case if we’ll not find the root cause - we’ll try to test things on the same system.

thanks mirfan , it’s working.

perl-DBD-MySQL is required

yum install perl-DBD-MySQL

My os is CentOS

oracle mysql , community version

the version is 5.5.31

I just wanted to add this.

If you have problems with this issue, perl-DBD-MySQL is indeed required (at least on my end, CentOS). Additionally, if it still doesn’t work, I suggest to locate your mysql.so file (ex. mine is located at /usr/local/lib64/perl5/auto/DBD/mysql/mysql.so), then check by ldd. If you have a different path of your MySQL installation, I suggest you need to install perl-dbd via source i.e. http://www.cpan.org/modules/by-module/DBD/ which then, by default, after compiling the source will place my shared-object to /usr/local/ directory unless path is configured.

Then ensure that you have your mysql.so points to the right library by calling ldd, i.e.

[root@centos DBD-mysql-4.023]# ldd /usr/local/lib64/perl5/auto/DBD/mysql/mysql.so
linux-vdso.so.1 => (0x00007ffffa1ff000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f60f2921000)
libm.so.6 => /lib64/libm.so.6 (0x00007f60f269d000)
librt.so.1 => /lib64/librt.so.1 (0x00007f60f2495000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f60f2291000)
libc.so.6 => /lib64/libc.so.6 (0x00007f60f1efe000)
/lib64/ld-linux-x86-64.so.2 (0x00007f60f2d5d000)

if it you notice it doesn’t points to the correct shared object, you can then do the following,

perl Makefile.PL --testuser=root --testpassword=root --ssl --mysql_config=/opt/local/mysql/bin/mysql_config --with-mysql=/opt/local/mysql --libs="-L/opt/local/mysql/lib -lmysqlclient -lpthread -lm -lrt -ldl"

That means, -libs specifies the flag on my library where to locate it which my MySQL is installed in path /opt/local/mysql and libmysqlclient.so is within /opt/local/mysql/lib.

Ensure you run make test, for testing that’s why I provide --testuser --testpassword options.

Now checking and ensuring it’s dynamic dependencies,

[root@centos DBD-mysql-4.023]# ldd /usr/local/lib64/perl5/auto/DBD/mysql/mysql.so
linux-vdso.so.1 => (0x00007fff5b5ff000)
libmysqlclient.so.18 => /opt/local/mysql/lib/libmysqlclient.so.18 (0x00007f07b6d29000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f07b6b0b000)
libm.so.6 => /lib64/libm.so.6 (0x00007f07b6887000)
librt.so.1 => /lib64/librt.so.1 (0x00007f07b667f000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f07b647b000)
libc.so.6 => /lib64/libc.so.6 (0x00007f07b60e8000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f07b5dd3000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f07b5bbc000)
/lib64/ld-linux-x86-64.so.2 (0x00007f07b7512000)

you’ll notice that I have libmysqlclient.so.18 listed now. Anyway, this is just a support post that might fix a problem that you might encounter even having DBD::module already installed or perl-DBD-MySQL (CentOS, libdbd-mysql-perl for Ubuntu) is installed.