On restoring a site on new cpanel server, got following error
Error while connecting to MySQL. Failover enacted. install_driver(mysql) failed: Cant 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 hasntbeen 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.
4 Responses to Cpanel Error – Can’t locate DBD/mysql.pm