Page 1 of 1

mySQL_connect - access denied for new user

PostPosted: 20. April 2011 10:31
by Koocka
Hi all!

I have a strange problem. A have installed xampp, and i try to use the mysql database with php. I tested the things with root, everything works fine. but i wanted to create an own username and password to use. I created the new user, granted all privileges, set host to any ( % ) , even created a new database to it, and granted all database privileges and all table privileges. finally a flush privileges, so i have a root-like user. the problem is, i cant even connect to the database with this user and password. it says :
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'koocka'@'localhost' (using password: YES) in C:\xampp\htdocs\reg.php on line 6

any ideas ? what should i try?

Re: mySQL_connect - access denied for new user

PostPosted: 20. April 2011 11:28
by Altrea
localhost is not part of the wildcard % as far as i know.
To grand the user access from localhost create a second entry for this user with host = localhost

Re: mySQL_connect - access denied for new user

PostPosted: 20. April 2011 13:12
by Koocka
now that's what i wouldn't think about for years... :idea: you were right, localhost is not a part of %. I copied the user just changed the host to localhost, and it works fine. Thank you very much for your help Altrea! :wink:

Re: mySQL_connect - access denied for new user

PostPosted: 20. April 2011 13:31
by Altrea
You're welcome 8)