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, });