问题
When i am trying to establish a connection to database, it fails. But It doesnt return any error message either.
Code for it is as below
my $dbh;
$dbh = DBI->connect('DBI:SQLAnywhere:', $connString, undef, {PrintError => 0, PrintWarn => 0})or die "died",$DBI::errstr,"\n";
#dbh = DBI->connect('DBI:SQLAnywhere:', $connString);
# setting up the authentication signature for the connection
print "$dbh";
if($dbh)
{
if(DbAuth::AuthenticateConnection($dbh))
{
return($dbh,$DbAuth::errstr) if (wantarray());
}
}
if (wantarray())
{
# The caller is prepared to deal with errors, so pass back the
# error string. It should only be used when the db_handle is 0.
return ($dbh, $DBI::errstr);
}
else
{
return $dbh;
}
Any idea why this is happening and how can i debug this issue?
Note: I upgraded perl from 5.8 to 5.24
来源:https://stackoverflow.com/questions/44906829/dbi-connect-fails-to-establish-the-connection-and-doesnt-return-an-error-messa