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
|
---|
In Section
Seekers of Perl Wisdom