use DBI; $dsn="DBI:mysql:db"; $dbh=DBI->connect($dsn,'user','pass'); $dbh->do('SQL文'); $dbh->disconnect;