Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rights for user to create drop and grant rights

Status
Not open for further replies.

scrsadmin

Technical User
May 3, 2004
62
US
I have a users that need to be able to create database drop database and grant rights to database. I don't want to give them root userid password but they do need the rights to create database, drop database and grant rights to database.

But i don't want them having rights for other databases.

How can i do this in mysql?

I am new to mysql so i have no clue but desire the knowledge.
 
Using the MYSQL Administrator tool, it should be a simple matter of clicking a couple thing and assigning permissions to the specific database.

If you want to do it as a query it be something like:

Code:
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
    ->     ON db_name.*
    ->     TO 'user'
    ->     IDENTIFIED BY 'password';

but I still think the Mysql Administrator way is easier. Its a visual GUI tool, just point and click to the desired rights for the user.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Is this what you mean?
Code:
GRANT ALL ON [i]yourdatabase[/i].* TO [i]yournewuser[/i]@localhost IDENTIFIED BY '[i]hispassword[/i]' WITH GRANT OPTION;

I did just that for a passwordless user that has to do database updates after the subversion updates on my development machines. It works, but those updates complain on databases that user has no rights to.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top