PERL-MYSQL

前端之家收集整理的这篇文章主要介绍了PERL-MYSQL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

####1 安装wget http://www.cpan.org/modules/by-module/DBI/DBI-1.623.tar.gztar -zxvf DBI-1.623.tar.gzcd DBI-1.623perl Makefile.PLmakemake installwget http://www.cpan.org/modules/by-module/DBD/DBD-MysqL-4.022.tar.gztar zxf DBD-MysqL-4.022.tar.gz cd DBD-MysqL-4.022perl Makefile.PL --MysqL_config=/usr/local/MysqL/bin/MysqL_configmake && make install####2 测试#!/usr/bin/perl -w use strict; use DBI;my $dbname="test";my $location="110.110.110.1";my $port="3306";my $database="DBI:MysqL:$dbname:$location:$port";my $dbh = DBI->connect($database,"yeqing","yeqing123456"); my $sth = $dbh->prepare ("select * from test.group");   $sth->execute();   while (my @row = $sth->fetchrow_array()) {      print "=====> @row <=========\n";   }   $sth->finish();   $dbh->disconnect();

猜你在找的Perl相关文章