Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
MySQL weird "access denied" problem can't connect via PHP lZakl msg:3195068 8:52 pm on Dec 20, 2006 (gmt 0) When I set up a new user, I can't connect to the MySQL databse via PHP. It gives me:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'example'@'localhost' (using password: YES) in connect-test.php on line 32
The problem is that using the same username and password in 2 different MySQL management tools it connects just fine. It is only through PHP that the authorization fails. What could cause this?
I have even tried changing the password to "OLD_PASSWORD" and even tried it non-encrypted "in the clear" for testing purposes. I really am stumped with this one!
volatilegx msg:3195147 10:06 pm on Dec 20, 2006 (gmt 0)
Make sure localhost is in the list of allowable domains from which to accept connections. lZakl msg:3195876 2:48 pm on Dec 21, 2006 (gmt 0)
I found that if I create a new user with localhost as the domain instead of %, it works. So I am guessing that localhost isn't included in %? If that's the case, how can I get it to be, or do I have to create duplicate users: One with % as the domain and one with localhost as the domain?