homepage Welcome to WebmasterWorld Guest from 54.243.12.156
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
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!

-- Zak

 

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?

-- Zak

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved