Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-10-20 15:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (263 votes). Check out past polls.

    Notices?