Home Database Mysql Tutorial 在Linux系统上安装Perl DBI支持

在Linux系统上安装Perl DBI支持

Jun 07, 2016 pm 04:52 PM
perl

如果你想编写一些能够访问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

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Develop efficient web crawlers and data scraping tools using Vue.js and Perl languages Develop efficient web crawlers and data scraping tools using Vue.js and Perl languages Jul 31, 2023 pm 06:43 PM

Develop efficient web crawlers and data scraping tools using Vue.js and Perl languages

Best practices for building high-performance web applications using Python and Perl Best practices for building high-performance web applications using Python and Perl Jun 17, 2023 am 08:09 AM

Best practices for building high-performance web applications using Python and Perl

Develop system scripts and automation tools using Vue.js and Perl languages Develop system scripts and automation tools using Vue.js and Perl languages Jul 29, 2023 pm 04:57 PM

Develop system scripts and automation tools using Vue.js and Perl languages

How to use Nginx as a Perl program server and its Perl module under Linux How to use Nginx as a Perl program server and its Perl module under Linux May 16, 2023 pm 11:25 PM

How to use Nginx as a Perl program server and its Perl module under Linux

perl regular expression perl regular expression Jun 30, 2023 pm 03:48 PM

perl regular expression

Redis and Perl language development: building efficient command line tools Redis and Perl language development: building efficient command line tools Jul 31, 2023 pm 04:09 PM

Redis and Perl language development: building efficient command line tools

How to develop distributed file synchronization function using Redis and Perl 6 How to develop distributed file synchronization function using Redis and Perl 6 Sep 21, 2023 pm 05:09 PM

How to develop distributed file synchronization function using Redis and Perl 6

How to develop a simple key-value storage function using Redis and Perl How to develop a simple key-value storage function using Redis and Perl Sep 22, 2023 am 09:00 AM

How to develop a simple key-value storage function using Redis and Perl

See all articles