It seems like you have forgotten to send the username and password to the database. Add a "user='MY_USERNAME'; password='MY_SECRET_PASSWORD'" to the dsn-string.MySQL can be very picky about usernames and passwords, so double check that you are allowed to connect to your database from the machine on which your script runs and that you have all the privileges necessary.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] [d/l] |
Synopses tend not to include things like error checking. So you should have kept the 'or die $dbh->errstr()' from your original example. Then you would have had a better error message than the one you received. Even better, RaiseError makes DBI error checking simple...look in the DBI docs for it. | [reply] |