mySQL_connect - access denied for new user

Problems with the Windows version of XAMPP, questions, comments, and anything related.

mySQL_connect - access denied for new user

Postby Koocka » 20. April 2011 10:31

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?
Koocka
 
Posts: 2
Joined: 20. April 2011 10:25

Re: mySQL_connect - access denied for new user

Postby Altrea » 20. April 2011 11:28

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
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: mySQL_connect - access denied for new user

Postby Koocka » 20. April 2011 13:12

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:
Koocka
 
Posts: 2
Joined: 20. April 2011 10:25

Re: mySQL_connect - access denied for new user

Postby Altrea » 20. April 2011 13:31

You're welcome 8)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: hthnightwolf and 68 guests