Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2014-09-24 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (243 votes), past polls