MySQL connect enquiy


New Member
Hi all,

I have been trying to connect to a database using a username and password which I have created through cPanel, and added to them to the database. I have used the following to connect:


//connect script

$erorr = "Problem connecting to database. Please try again later.";

$connect = mysql_connect("", "username", "password") or die ($erorr);
mysql_select_db("mydatabase") or die ($erorr);


The output is as follows:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'' (using password: YES) in /home/public_html/connect.php on line 7

btw, I made sure many times to put the right authentication info, so there is nothing wrong with the username and the password.

Please guide how to fix this error and I will be greatly appreciated.

Thank you in advance