Home: Perl Programming Help: DBI:
DBD::mysql is installed but still error Can't locate DBD/mysql.pm in @INC



newbielgn
New User

Aug 18, 2011, 3:55 AM


Views: 16203
DBD::mysql is installed but still error Can't locate DBD/mysql.pm in @INC

Hi,

DBD::mysql is installed successfully please see (1) below.
But still i get error as given in (2) below:
Please help to resolve this error

~Thanks

(1) Successful installation message
[user@mysystem]$ perl -MCPAN -e 'install DBD::mysql'
CPAN: Storable loaded ok (v2.19)
Going to read /root/.cpan/Metadata
Database was generated on Wed, 17 Aug 2011 04:32:32 GMT
DBD::mysql is up to date (4.019).

(2) Error message:
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . ) at (eval 15) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge.


FishMonger
Veteran / Moderator

Aug 18, 2011, 6:10 AM


Views: 16193
Re: [newbielgn] DBD::mysql is installed but still error Can't locate DBD/mysql.pm in @INC

It appears to me that you may have both a 64bit and a 32bit version of perl installed. In which version was the module installed and is that the same version that your script is using?

What is the actual path to the module and is that path in the @INC array?


newbielgn
New User

Aug 18, 2011, 6:23 AM


Views: 16191
Re: [FishMonger] DBD::mysql is installed but still error Can't locate DBD/mysql.pm in @INC

Script was using /usr/bin/perl but I had installed mysql.pm for perl in /usr/local/bin/perl
when i used /usr/local/bin/perl in my script it worked.

Thank you very much