Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Oct 9 '09 at 6:42

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

might help:… – Tarnay Kálmán May 19 '10 at 16:08

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


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.