加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

PERL-MYSQL

发布时间:2020-12-15 23:39:57 所属栏目:大数据 来源:网络整理
导读:####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

####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();

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读