connect to MSYQL with Perl

Avatar
  • Answered
I have a perl script in my cgi-bin for connecting to my mysql database. The connect script isn't working. Using the Perl Module, DBI:MYSQL I'm unable to get the following work: $dbh = DBI->connect( "dbi:mysql:bigcom5_redearthpublishing:localhost:3306", "", "") The resultant error is: Access denied for user 'bigcom5_redearth'@'localhost' (using password: YES) I've also tested the dbi:mysql statement with and without the port number -- same results. I've set up a user for this database in my cpanel, but for security, I've removed both the username and psswd from this post. Thanks!
Avatar
JacobIMH
Hello bigcomposer, and thanks for the question. I'm not sure exactly what happened, but I was getting an error denied when trying to access the MySQL database directly as well with your database user. I simply removed, and re-created and attached the database user, using the same password you had defined in your Perl script, and it started working now. Please let us know if you're still having any issues at all. - Jacob