Hello all,
I'm running MySQL and PHP on a Windows 2000 server. I have a script that connects to a database but I continually get this error:
Access denied for user: 'myuser@localhost' (Using password: YES)
I connect with this:
$connection=mysql_connect("localhost","myuser","userpass");
mysql_select_db("mydb",$connection);
I had first been testing with no username or password.
Since I have access to the database I decided to password protect it.
I entered the following commands at the mysql> prompt:
mysql> USE mysql;
mysql> INSERT INTO user (Host, User, Password, Select_priv) VALUES ('', 'myuser', password('userpass'), 'Y');
mysql> GRANT ALL ON mydb.* TO myuser;
mysql> FLUSH privileges;
mysql> quit
When I try to connect to the database throught the mysql consol with
mysql -D mydb -u myuser -p userpass
I get the error message: Access denied.
I can access the database as root with the script and the console but nothing else.
Any help would be great.
Thanks