Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to have a MySQL user that will only able to create a new user+database(+password) combinations - without being the mysql root user for obvious security concerns.

My idea is to have a secure user (INSERT privileges only) that will modify the mysql table directly, but I don't know if there are consequences.

To be clear, I want to create a user that will only be able to generate users+database+password combinations using an automated script that will run using that user. I want that user to operate on the least permissions as possible.

What are my other options?

share|improve this question

migrated from stackoverflow.com Oct 9 '09 at 6:42

This question came from our site for professional and enthusiast programmers.

    
might help: serverfault.com/questions/128740/… –  Tarnay Kálmán May 19 '10 at 16:08

1 Answer 1

You can do it using the normal GRANT system in MySQL. But the user you're using will need all the same access they're trying to GRANT. You can only do GRANTs with the same permissions or less than your current user.

Don't start messing around with the system tables, it's not necessary.

share|improve this answer
    
I just created a user with only the GRANT privilege. I cannot create new database. –  LiraNuna Oct 9 '09 at 6:24
    
You need more than just the GRANT privilege. You will need to give the user other privileges as well. Refer to the MySQL docs for a list of privileges to grant. –  sybreon Oct 9 '09 at 7:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.