I am getting Access Denied error in my Database Connection

The error “Access denied for user” might be due to the wrong database username,password or database name.Also check with the following sample database connection string as,

Sample Database Connection String:

$dbh=mysql_connect (“localhost”, “cpuser_dbuser–> this is database username”,
” –>this is databaseuser password”) or die(‘Cannot connect to the database because: ‘ . mysql_error());
mysql_select_db (“cpuser_dbname–>this is database name”);