Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DBD-mysql installed ,but still error "install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC"

Tags:

perl

Install information:

Using DBI 1.608 (for perl 5.008009 on x86_64-linux) installed in /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/auto/DBI/

error information:

[root@datacenterETL DBD-mysql-4.020]# perl ../testConnect.pl install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.9/x86_64-linux /usr/local/lib/perl5/5.8.9 /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux /usr/local/lib/perl5/site_perl/5.8.9 .) at (eval 3) line 3.

Perhaps the DBD::mysql Perl module hasn't been fully installed, or perhaps the capitalisation of 'mysql' isn't right.

like image 768
Albert Avatar asked Jun 17 '13 09:06

Albert


4 Answers

It looks like you're using Linux. In that case, you might find it easier to install a pre-packaged version of the module.

On a Red Hat derivative try yum install perl-DBD-mysql; on a Debian derivative try apt-get install libdbd-mysql-perl.

like image 110
Dave Cross Avatar answered Oct 19 '22 21:10

Dave Cross


Perhaps the DBD::mysql perl module hasn't been fully installed

...so install it.

cpan DBD::mysql 

Or since you don't have internet access,

perl Makefile.PL make make test make install 

You'll need MySQL's development header files installed first, as per INSTALL

like image 29
ikegami Avatar answered Oct 19 '22 23:10

ikegami


any error related to DBD::mysql error has not installed fully. Please run the below code in super user permission.

apt-get install libdbd-mysql-perl
like image 34
chandraprakash Avatar answered Oct 19 '22 23:10

chandraprakash


As is was not able to comment (yet), I want to add something for the Mac Users. I hat to add the --force command to install the everything properly as i have no local mySQL installation for the tests to pass. /usr/bin/cpanm --force DBD::mysql worked for me. (Mac OS 10.9.2, Perl 5.12.4)

like image 37
Daywalker Avatar answered Oct 19 '22 23:10

Daywalker