Hanson, Robert wrote:
>"How do I CREATE a database from within perl with MySQL?"
>
>I don't think you can... but you can run the mysql interface from the
>script. Actually I think that you can pipe a list of commands to mysql.
>
>Rob
>
If you can get a connection with proper permissions, all yo
James,
I am using mandrake linux 8.1 and have a command 'mysqladmin' i wouldn't
of thought this was anything special to mandrake so check to see if you have
that command. If you have then it is a simple case of executing :-
mysqladmin create
just type the command on it's own to see
forget the 'use dbUtil;'. that was my own utility module.
On Tuesday, March 19, 2002, at 03:20 PM, bob ackerman wrote:
> this is how i am doing it:
>
> use CGI qw(:standard);
> use DBI;
> use dbUtil;
>
> $db_name = param('db_create'); # however you want to get the db name to
> create
>
> $drh
this is how i am doing it:
use CGI qw(:standard);
use DBI;
use dbUtil;
$db_name = param('db_create'); # however you want to get the db name to
create
$drh = DBI->install_driver('mysql') or die "couldn't install driver";
$drh->func('createdb', "$db_name", '','','', 'admin')
or
"How do I CREATE a database from within perl with MySQL?"
I don't think you can... but you can run the mysql interface from the
script. Actually I think that you can pipe a list of commands to mysql.
Rob
-Original Message-
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, M
You could connect to the mysql database. You don't need any permissions
to connect to a database, so this should work out fine. Though, the
question remains as to how you will set up the permissions from a perl
script. If you can use the mysqladmin, then you could always create the
database