MySQL Forums
Forum List  »  Newbie

Re: Creating Users
Posted by: Javier Rodriguez Paiva
Date: August 18, 2005 09:48AM

Hi Jeff,

GRANT ALL PRIVILEGES ON *.* TO username@"%" IDENTIFIED BY 'password' WITH GRANT OPTION;

would be useful in case you want to create another root account (with all privileges for everything, even creating new users).

I think what you are looking for is something more like:

GRANT ALL PRIVILEGES ON *.* TO user@'%' IDENTIFIED BY 'password';

That way the user won't have the privileges for GRANT and REVOKE.
However, he would still be able to access mysql database and could use DELETE's or UPDATE's to modify the user table (deleting users and changing passwords perhaps). I'm not really sure on how to avoid that, since mysql (and even information_schema) is a database as any other one, and if you give a user permissions to edit all databases, it could edit mysql as well.

The only solution I can think right now would be creating a user just for creating databases, and then having the root account granting him privileges for the db he/she just created. It would go like this:

GRANT CREATE ON *.* TO 'db_creator'@'%' IDENTIFIED BY 'password';

and, when db_creator creates a new database (let's say... new_db); the root account would have to grant him/her privileges like:

GRANT INSERT, SELECT, UPDATE, DELETE ON new_db.* TO 'db_creator'@'%' IDENTIFIED BY 'password';

I know its not the smartest way, so if you or anyone else come up with any ideas, it would be really interested in reading them.

Options: ReplyQuote


Subject
Written By
Posted
August 16, 2005 06:21PM
August 17, 2005 10:07AM
August 17, 2005 07:12PM
August 17, 2005 07:47PM
August 17, 2005 09:30PM
Re: Creating Users
August 18, 2005 09:48AM
August 18, 2005 02:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.