Home > Database > Mysql Tutorial > body text

在Linux系统上安装Perl DBI支持

WBOY
Release: 2016-06-07 16:52:36
Original
1245 people have browsed it

如果你想编写一些能够访问MySQL数据库的Perl脚本,就需要安装DBI模块,需要安装两组DBI模块,一组是负责提供各种DBI基本驱动程序

如果你想编写一些能够访问MySQL数据库的Perl脚本,就需要安装DBI模块,需要安装两组DBI模块,一组是负责提供各种DBI基本驱动程序的 DBI模块,另一组是负责提供各种MySQL专用驱动程序的DBD::mysql模块,如果你还想编写一些基于Web的DBI脚本,那就还得安装 CGI.pm模块,可以利用perldoc命令来查知某个Perl模块是否已经安装好了,如果已经安装了该模块,perldoc命令就会把该模块的文档显示出来,如下所示:

%perldoc DBI
%perldoc DBD::mysql
%perldoc CGI

如果想把Perl模块安装到Linux系统上,最简单的办法就是使用CPAN shell,以root身份登陆,然后发出如下命令:

#perl -MCPAN -e shell
cpan>install DBI
cpan>install DBD::mysql
cpan>install CGI

还可以从cpan.perl.org站点下载tar压缩文件形式的源代码发行版本,解压缩后,切换到相应的文件目录

cd DBI-1.54
perl Makefile.PL
make
make test
make install

安装过程中,在make test时出现错误

t/zvxgp_85gofer...........Can't locate Time/HiRes.pm in @INC (@INC contains: /root/DBI-1.54/blib/lib/5.8.5/i386-linux-thread-multi /root/DBI-1.54/blib/lib/5.8.5。)

说明无法找到Time/Hires.pm,到

网站下载后,通过上面的方法安装后,再重新安装DBI-1.54就好了,然后继续安装DBD::mysql

cd /root/DBD-mysql-4.001
perl Makefile.PL
make
make test
make install

安装过程中报错没有找到mysql_config文件
ln -s /usr/local/mysql/bin/mysql_config /sbin/mysql_config

做了链接后再perl Makefile.PL问题解决。 

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!