Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: how to create a database in perl

by erix (Vicar)
on Jan 28, 2011 at 14:30 UTC ( #884835=note: print w/ replies, xml ) Need Help??


in reply to how to create a database in perl

You control that via the dsn; see the DBD::mysql docs (second line of the synopsis):

$dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";

Specifically: the 'database=$database;' part.

The part of the dsn after 'dbi:<driver>:' is given as a whole to the specific database driver; what the driver expects is specific to that driver. For example, in the case of postgresql database driver DBD::Pg, the database can be given with either 'database', 'dbname', or 'db'.


Comment on Re: how to create a database in perl
Download Code
Re^2: how to create a database in perl
by Your Mother (Canon) on Jan 28, 2011 at 14:41 UTC
    the database can be given with either 'database', 'dbname', or 'db'

    I think the question is "how can the database name not be given?"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://884835]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2014-07-29 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (213 votes), past polls