Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^3: How to find MySQL database exist or not

by Marshall (Monsignor)
on Sep 03, 2011 at 04:06 UTC ( #923959=note: print w/replies, xml ) Need Help??

in reply to Re^2: How to find MySQL database exist or not
in thread How to find MySQL database exist or not

I think that you are mixing up a couple of things.

There is a dataset name ($dsn) which is a mySQL database on a particular host name and port number. That has to exist or you are going "nowhere"!

If the $dsn exists, then you can attempt to connect to it. This is where the user name and passwords are required.

my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port" || die "DB data set name failed $!\n"; # # second step # # my $dbh = DBI->connect($dsn, $user, $password) || die "DB connect failed $!\n";
The $dsn and the final connected handle, $dbh are very different things.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://923959]
and the monks are chillaxin'...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2016-12-05 13:46 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (82 votes). Check out past polls.