全部博文(279)
分类:
2008-01-22 17:22:50
#!/usr/bin/perl
use strict;
use DBI;
my $dbh = DBI->;connect("dbi:mysql:dbname", 'user','passwd', '')
or die "can't connect!\n";
my $sql = qq/show variables/;
my $sth = $dbh->;prepare($sql);
$sth->;execute();
while(my @array=$sth->;fetchrow_array())
{
printf("%-35s", $_) foreach(@array);
print "\n";
}
$dbh ->; disconnect();
exit 0;