HostOnNet Blog

Cpanel Error – Can’t locate DBD/mysql.pm

Looking for Linux Server Admin or WordPress Expert? We can help.

On restoring a site on new cpanel server, got following error

Error while connecting to MySQL. Failover enacted. install_driver(mysql) failed: Can’t locate DBD/mysql.pm in @INC(@INC contains: /usr/lib/perl5/ 5.8.7/ i686-linux/usr/lib/perl5/ 5.8.7 /usr/lib/perl5/ site_perl/ 5.8.7/i686-linux /usr/lib/perl5/ site_perl/5.8.7 / usr/lib/perl5/site_perl/ 5.8.5 /usr/lib/perl5/site_perl/ 5.8.4/usr/lib/perl5/site_perl/ 5.8.3 /usr/lib/perl5 /site_perl/5.8.2 /usr/lib/perl5/ site_perl/5.8.1 /usr/lib/perl5/ site_perl/5.8.0 /usr/lib/perl5/ site_perl ./scripts /scripts /scripts /scripts /scripts/scripts /scripts /scripts) at (eval 32) line 3.Perhaps the DBD::mysql perl module hasn’tbeen fully installed,

The problem is due to Perl module DBD::mysql mising.

This can be downloaded from cpan.org

To install it, unzip it, then cd to the source folder, then run

# perl MakeFile.pl
# make
# make install

Or you can do it with cpan command

# perl -MCPAN -e shell
cpan> install Bundle::DBD::mysql
cpan> install Bundle::DBI

cpan> exit
#

Or with

# perl -MCPAN -e ‘force install DBD::mysql’

Recent version of new cpanel server have many Perl related errors, this can be fixed by reinstalling perl from Cpanel site. Installation is easy, just download perl from

http://layer2.cpanel.net/perl587installer.tar.gz

Then unzip it

# tar -zxvf perl587installer.tar.gz

Change to the folder and follow the instructions in INSTALL file.

Posted in Uncategorized. Bookmark the permalink.

4 Responses to Cpanel Error – Can’t locate DBD/mysql.pm

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.