Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Unable to connect to database

by Tux (Monsignor)
on Aug 07, 2013 at 11:33 UTC ( #1048337=note: print w/ replies, xml ) Need Help??

in reply to Unable to connect to database

Besides that, your code won't work. The driver part of the DSN separates by semi-colons, not by colons:

my $data_source = "DBI:mysql:database=" . $db . ":host=" . $host . ":p +ort=" . $port; my $dbh = DBI->connect($data_source,$user,$password,{ PrintError => 0} +);


my $data_source = "dbi:mysql:database=$db;host=$host;port=$port"; # these colons should be semi-colons ^ ^ my $dbh = DBI->connect ($data_source, $user, $password, { PrintError => 0, });

Enjoy, Have FUN! H.Merijn
my $data_source =

Comment on Re: Unable to connect to database
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2016-02-10 16:42 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (352 votes), past polls