简体   繁体   中英

Installation of DBI module in Perl facing issue

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.

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 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM