简体   繁体   English

在Perl中安装DBI模块面临的问题

[英]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 我在Centos 7服务器上安装了DBI模块,但每当我尝试通过Perl脚本连接到mysql时,我的ERROR如下所示,请帮助

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. install_driver(mysql)失败:无法在@INC中找到DBD / mysql.pm(您可能需要安装DBD :: mysql模块)(@INC包含:/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)第3行。也许DBD :: mysql perl模块还没有完全安装,或者'mysql'的大小写可能不正确。 Available drivers: DBM, ExampleP, File, Gofer, Mem, Multiplex, Proxy, Sponge. 可用的驱动程序:DBM,ExampleP,File,Gofer,Mem,Multiplex,Proxy,Sponge。 at Registration.pl line 93. 在Registration.pl第93行。

You need to install perl-DBD-MySQL . 您需要安装perl-DBD-MySQL

Edit: I read your error message and you are using a non-system perl in /usr/local (perl 5.24.1). 编辑:我读了你的错误信息,你正在使用/ usr / local中的非系统perl(perl 5.24.1)。 If you are using that instead of the system perl, you can do: 如果您使用的是系统而不是系统perl,则可以执行以下操作:

cpan DBD::mysql DBI

You may need to also do: 您可能还需要:

yum  install mysql-devel 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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