Hi. I am having trouble with this:


$host="localhost"; // Host name 
$username="username"; // Mysql username 
$password="password"; // Mysql password 
$db_name="database"; // Database name 
$tbl_name="table"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect"); // Line with the error (Line 8)
mysql_select_db("$db_name")or die("Error. MySQL Not Responding.");


I recently changed the phpmyadmin login password to the database...
and I get this error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in pageURL on line 8

I used the correct password, but it continues to say Access Denied, even though I have the password right. All the login/passwords are right....Not one thing of info is incorrect....The host I use is 000webhost if that helps...I did change the password to the phpmyadmin account at exactly 30 minutes ago. It said to wait one minute... I don't know what is wrong, but it used to work. It just stopped all of a sudden. I would be happy if you helped.

5 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.