Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 });