PDA

View Full Version : Granting database specific users with password


mrcawfee
02-09-02, 04:18
I have a user who only has select,insert,update,delete,grant option to a database, if i am logged in with that user and i attempted to create another user with a password like this

mysql> grant insert,update,select,delete on cawfee.* to moo@localhost identified by "bacon";

I will get the message:

ERROR 1044: Access denied for user: 'cawfee@localhost' to database 'mysql'

It seems like the user cawfee@localhost must have write access to mysql.* to give a user a password, although i can add the user just fine without a password... I'd rather not give cawfee@localhost access to the mysql database either. Anyone? Anyone?

jimo
01-19-03, 18:01
I recently had a similar experience; here's what I figured out. First, have root create the moo@localhost user with a password (with SELECT access to test, or something). Once that's done, your cawfee@localhost user can grant applicable privileges without specifying a password. The user moo@localhost will have the new privileges but will not be able to log in without the original password provided by root.

Hope this helps.

Originally posted by mrcawfee
I have a user who only has select,insert,update,delete,grant option to a database, if i am logged in with that user and i attempted to create another user with a password like this

mysql> grant insert,update,select,delete on cawfee.* to moo@localhost identified by "bacon";

I will get the message:

ERROR 1044: Access denied for user: 'cawfee@localhost' to database 'mysql'

It seems like the user cawfee@localhost must have write access to mysql.* to give a user a password, although i can add the user just fine without a password... I'd rather not give cawfee@localhost access to the mysql database either. Anyone? Anyone?