I'm trying to connect to a mySql database using PHP but I am being denied access to the database.
Warning: mySql_connect(): Access denied for user: 'robbie@localhost' (Using password: YES) in C:\Program Files\Apache Group\Apache2\htdocs\hello.php on line 6
Error connecting to mySql
Here is my PHP
$dbhost = 'localhost';
$dbuser = 'robbie';
$dbpass = 'password';
$conn = mySql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mySql');
$dbname = 'petstore';
I created the mySql account like this...
mySql> INSERT INTO user (host, user, password, select_priv, insert_priv, update_priv, delete_priv, create_priv, drop_priv) VALUES ('localhost', 'robbie', 'password', 'Y', 'Y', 'Y', 'Y', 'Y','Y');
Query OK, 1 row affected (0.00 sec)
mySql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
Does anybody have an idea what is causing the error?
I know that without the FLUSH PRIVILEGES command the user will not be able to connect to the database and after the FLUSH PRIVILEGES command above it says "0 rows affected"!
Does this mean that FLUSH PRIVILEGES command did not take effect?
Thank you for reading!
Edited by brennr26, 12 March 2006 - 04:08 PM.