I'm trying to create a database in Perl but it keeps trying to ask me for a database to use. Here's my code:
my @db_months = qw(JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC);
foreach my $db_month (@db_months)
{
## create db
my $db_name = $db_month.$Year;
my $dbh = DBI->connect($dns, $user, $password) or die "Unable to connect: $DBI::errstr\n";
my $row = $dbh->do("CREATE DATABASE '".$db_name."' DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;");
$dbh->disconnect();
}
Please help.
$dnscontain? What error do you get?$dnswould be$dsn.