#!/usr/bin/perl
use strict;
use DBI;
my $user="root";
my $passwd="123456";
my $host="192.168.10.239";
my $dbtest1="test";
my $data_source_test1="DBI:mysql:database=$dbtest1;host=$host";
my $dbh=DBI->connect($data_source_test1,$user,$passwd,{'RaiseError'=>1});
my $sql=qq/select s1 from t1/;
my $sth=$dbh->prepare($sql) ;
$sth->execute();
$sth->dump_results();
$sth->finish();
$dbh->disconnect();
阅读(1816) | 评论(0) | 转发(0) |