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

Q&A > database programming > How can I see error messages from MySQL? - Answer contributed by btrott

To follow up with what BBQ wrote... you can either check the return value of your database functions, or you can just use the RaiseError attribute, which will die on an error:
my $dbh = DBI->connect($dsn, $user, $pass, 'mysql', { RaiseError = +> 1 });