Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Using DB->connect for mysql db without password

by rnewsham (Chaplain)
on Sep 11, 2013 at 13:54 UTC ( #1053501=note: print w/replies, xml ) Need Help??


in reply to Using DB->connect for mysql db without password

Having databases without passwords is a bad idea, but if you really must do it the following code works for me.

my $database = 'test'; my $dbh = DBI->connect("DBI:mysql:$database",undef,undef,{ RaiseError +=> 1 });

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053501]
help
Chatterbox?
What's the matter? Cat got your tongue?...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2017-08-21 15:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (324 votes). Check out past polls.

    Notices?