Help with "'Error connecting to mysql"

I tried to upload a file via my web site, which uses a common php video-file-upload script, during the uploading process this page appeared:

“Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.”

So then I looked in the site script’s Error Log and I see this:

PHP Warning: mysql_connect() [<a href=‘function.mysql-connect’>function.mysql-connect</a>]:
Access denied for user ‘xyzadmin’@‘localhost’ (using password: YES) in /home/public_html/logout.php on line 25

So, I look at line 25 of the login.php file and I see this:
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’);

Can you shed some light on what I might do to remedy this? Or offer some guidance? I’m not very versed in databases, mysql or phpmyadmin.
Thanks

MySQL is just denying the connection. Check that the account exists and that the password being used is correct.

There could be a number of other reasons. Two common ones are that

  1. the firewalls are stopping connection on the port being used to connect to mysql.

  2. There are too many connections to mysql. Or perhaps put more accurately, since the problem lies with mysql, mysql has too many connections

Try connecting to your DB with the same login details from MySQLYog or Navicat (free trial version available).

There might also be an issue if MySQL used the new Password hashing method when the user account was created, but PHP sends it using the old hash - see http://dev.mysql.com/doc/refman/5.5/en/old-client.html , “Reset the password to pre-4.1 style” …