the example will connect to the local mySQL server and create a new
database named 'dbname
#!/usr/bin/perl -w
use DBI;
$dbh = DBI-connect( dbi:mysql:, 'user', 'password', {
PrintError = 0 } ) or die Can\t connect to database:
$DBI::errstr\n;
$dbh-do(create database dbname);
$dbh-disconnect or
I'd like to be able to create a new database using Perl/DBI instead of using
the MySQL command line (and other) utilities. It looks like you can create a
new database with the driver handle but I can't seem to make it work.
-