Reputation: 13
I have installed DBI module in Centos 7 server but whenever i am trying Connect to mysql through Perl script i am getting below ERROR as below please help on this
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: /usr/local/lib/perl5/site_perl/5.24.1/x86_64-linux /usr/local/lib/perl5/site_perl/5.24.1 /usr/local/lib/perl5/5.24.1/x86_64-linux /usr/local/lib/perl5/5.24.1 .) at (eval 1195) 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, Mem, Multiplex, Proxy, Sponge. at Registration.pl line 93.
Upvotes: 1
Views: 3032
Reputation: 820
You need to install perl-DBD-MySQL
.
Edit: I read your error message and you are using a non-system perl in /usr/local (perl 5.24.1). If you are using that instead of the system perl, you can do:
cpan DBD::mysql DBI
You may need to also do:
yum install mysql-devel
Upvotes: 3