http://www.perlmonks.org?node_id=1048337


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 =