Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Unable to connect to database

by Tux (Abbot)
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 =

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1048337]
[erix]: Zzz
[erix]: Coptics? :)
[robby_dobby]: erix: Coptic Christians in Egypt
[choroba]: Robocoptic!
[erix]: I like Coptics :)
[LanX]: Copts
[erix]: sorry - just pulling your leg
[robby_dobby]: erix: It's a little late for that :-)
[robby_dobby]: I was falling asleep at my chair and threw out that one bit about participating in a YAPC. Things went from there :-)
[erix]: never too late to pull legs

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (14)
As of 2017-04-24 16:13 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (442 votes). Check out past polls.