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. [URL]http://www.cpan.org/modules/by-module/DBD/[/URL] 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.