这个是去年管理测试环境的时候,直接用脚本批量操作数据库```perl

#!/usr/bin/perl -wuse DBI;use strict;my $dbh;my $INFILE=$ARGV[0];open LIST ,"<$INFILE" or die "can’t open $INFILE\n";my $table="table_appinfo";$dbh=&connect();my $qurey=qq{insert into $table (ip,name,manage,dev,location) values(?,?,?,?,?) };my $sth=$dbh->prepare($qurey) || die $dbh->errstr;my $dev="lab";my $manage="namexxx";my $location=’location’;while(my $line=){my ($ip,$name)=split /\s+/,$line;$sth->execute($ip,$name,$manage,$dev,$location);print "insert $ip $name\n";}$dbh->disconnect();