[thelist] MySQL User Problem

Phil Turmel philip at turmel.org
Thu Oct 12 15:13:30 CDT 2006


Randal Rust wrote:
> I think that my understanding of what goes on in MySQL -- how users
> and permissions are managed -- is wrong.
> 
> In the mysql.user table, I have defined a user...
> 
> Host: localhost
> Username: dba
> Password: foo
> 
> ...and granted all permissions to that user.
> 
> Next, I have added this to the mysql.db table...
> 
> Host: localhost
> Db: test_db
> User: dba
> 
> However, when I try to connect (via ADODB and PHP), I continue to get
> this error:
> 
> Access denied for user 'dba'@'localhost' (using password: YES)
> 
> I am trying to set this up through PHPMyAdmin, but I don't know if
> that has anything to do with it. Usually, I have a control panel that
> I am using that walks me through this. However, on this particular
> site, the client is running their own server, sans a control panel.
> 
> Where am I going wrong?
> 
Hi Randall,

Two things to check:

1) Did you Flush Priviledges after adding the user?
2) If you inserted the user on the mysql.user table, did you encrypt the 
password column?  The "GRANT ... IDENTIFIED BY ..." syntax does it for 
you, "INSERT INTO mysql.user ..." does not.

References:
http://dev.mysql.com/doc/refman/4.1/en/grant.html
http://dev.mysql.com/doc/refman/4.1/en/flush.html
http://dev.mysql.com/doc/refman/4.1/en/encryption-functions.html

HTH,

Phil

PS. I use PHPMyAdmin for all my MySQL administration.  It puts a link to 
"reload the priviledges" just about everywhere you might need it.



More information about the thelist mailing list