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


in reply to How can I see error messages from MySQL?

DBI has return values for each one of its calls, so it would be wise to or your connect statement, like:
$dbh = DBI->connect("DBI::mysql ... etc $dsn") or die("Couldn't connect to $dsn: $DBI::errstr\n");
this way, you'll always get an error message if something goes wrong.