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

**URL:** <https://forums.percona.com/t/failed-to-connect-to-mysql-server-as-dbd-mysql-module-is-not-installed/2922>\
**Category:** Percona XtraBackup\
**Created:** [September 5, 2013, 2:39am UTC](https://forums.percona.com/t/failed-to-connect-to-mysql-server-as-dbd-mysql-module-is-not-installed/2922 "2013-09-05T02:39:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZyBeR](https://avatars.discourse-cdn.com/v4/letter/z/9de053/32.png) [@ZyBeR](https://forums.percona.com/u/ZyBeR)\
**Post date:** [September 5, 2013, 2:39am UTC](https://forums.percona.com/t/failed-to-connect-to-mysql-server-as-dbd-mysql-module-is-not-installed/2922/1 "2013-09-05T02:39:21Z")

</div>

Hi guys,

I’ve been using innobackupex on my MySQL production server for a few years with no issues, now though I’ve noticed it has stopped working.  
I believe this has happened after a recent “apt-get upgrade”, but I’m not sure as I just found out about the problem.

The server it self is an Ubuntu Server x64 running the following software.

- Kernel: 3.2.0-40-generic
- MySQL: 5.5.32
- XtraBackup: 2.1.4
- Perl: 5.14.2

This is the script I’m running.  
#!/bin/sh

user=root  
pass=\*\*\*\*\*  
tmpdir=/media/data/tmp  
file=$tmpdir/mysql-$(date +%A).tar.gz

### Start MySQL Backup

echo “$(date): Starting MySQL backup.” \>\> /tmp/backup.log  
/usr/bin/innobackupex --user=$user --password=$pass --no-timestamp --rsync $tmpdir/backup  
/usr/bin/innobackupex --user=$user --password=$pass --apply-log --use-memory=1GB $tmpdir/backup

tar -zcvf $file $tmpdir/backup  
rm -rf $tmpdir/backup  
/usr/bin/scp $file [admin&#64;\*\*\*\*\*\*\*\*\*.com](mailto:admin&#64; *********.com):/share/MD0\_DATA/Backup/bb-mysql-01/  
rm $file

sync  
echo 1 \> /proc/sys/vm/drop\_caches

echo “$(date): Backup completed.” \>\> /tmp/backup.log

And here is the output.  
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.

130905 10:11:19 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/bin/innobackupex line 1614.

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.

IMPORTANT: Please check that the apply-log run completes successfully.  
At the end of a successful apply-log run innobackupex  
prints “completed OK!”.

Could not open required defaults file: /media/data/tmp/backup/backup-my.cnf  
Fatal error in defaults handling. Program aborted  
xtrabackup: Error: --defaults-file must be specified first on the command line  
innobackupex: fatal error: no ‘mysqld’ group in MySQL options  
tar: Removing leading `/’ from member names  
tar: /media/data/tmp/backup: Cannot stat: No such file or directory

I did an “apt-cache search perl dbd”.  
freetds-dev - MS SQL and Sybase client library (static libs and headers)  
libct4 - libraries for connecting to MS SQL and Sybase SQL servers  
libdbd-mysql-perl - Perl5 database interface to the MySQL database  
libdbd-sqlite3-perl - Perl DBI driver with a self-contained RDBMS  
libdbi-dev - DB Independent Abstraction Layer for C – development files  
libdbi-doc - DB Independent Abstraction Layer for C – documentation  
libdbi-perl - Perl Database Interface (DBI)  
libdbi1 - DB Independent Abstraction Layer for C – shared library  
postgresql-contrib-9.1 - additional facilities for PostgreSQL  
hobbit-plugins - plugins for the Xymon network monitor  
libanyevent-dbd-pg-perl - AnyEvent interface to DBD::Pg’s async interface  
libapache-dbilogger-perl - Perl module for tracking what’s being transferred in a DBI database  
libdbd-anydata-perl - perl DBI driver for files and data structures  
libdbd-csv-perl - DBI driver for CSV files  
libdbd-excel-perl - provides an SQL interface (via DBI) for accessing Excel files  
libdbd-firebird-perl - Perl DBI driver for Firebird RDBMS server  
libdbd-ldap-perl - Perl extension for LDAP access via an SQL/Perl DBI interface  
libdbd-mock-perl - Mock database driver for testing  
libdbd-odbc-perl - Perl Database Driver implementing ODBC for DBI  
libdbd-pg-perl - Perl DBI driver for the PostgreSQL database server  
libdbd-sqlite2-perl - Perl DBI driver with a self-contained RDBMS (SQLite2 version)  
libdbd-sybase-perl - Sybase/MS SQL database driver for the DBI module  
libdbd-xbase-perl - Perl module to access xbase files (optionally through DBI)  
libdbix-class-perl - extensible and flexible object ↔ relational mapper  
libdbix-dbschema-perl - Database-independent schema objects  
libdbix-fulltextsearch-perl - Indexing documents with MySQL as storage  
libdbix-recordset-perl - Perl extension for DBI recordsets  
libsql-statement-perl - module for parsing and processing SQL statements  
libtest-database-perl - support for testing against multiple unspecified databases  
postgresql-contrib-8.4 - additional facilities for PostgreSQL  
ruby-dbi - Database Independent Interface for Ruby

What can be causing the issue?  
As far as I can tell I’m running the latest stable version of all software, maybe there is some conflict there?

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![ZyBeR](https://avatars.discourse-cdn.com/v4/letter/z/9de053/32.png) [@ZyBeR](https://forums.percona.com/u/ZyBeR)\
**Post date:** [September 5, 2013, 3:23am UTC](https://forums.percona.com/t/failed-to-connect-to-mysql-server-as-dbd-mysql-module-is-not-installed/2922/2 "2013-09-05T03:23:15Z")

</div>

After I ran a little Perl script ( perl -MDBD::mysql -e 'print $DBD::mysql::VERSION ) I noticed it complained about the ssl library not being installed.

Odd that it’s needed when I don’t have ssl enabled on my MySQL server, but anyhow I installed the library to satisfy it.  
[B]

And now my backup seams to be working, at least it’s running now, we’ll see in a hour or so if it worked.
