Perl 使用 DBI 连接到数据库

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!\usr\bin\perl

use warnings;
use strict;
use DBI;
my $dbh=DBI->connect('dbi:mysql:test','root','password') || die "Error opening database: $DBI::errstr\n";
print "Hello\n";
$dbh->disconnect || die "Failed to disconnect\n";
print "Goodbye\n";