Two days ago one of my client dev’s requested me to be able to create db’s on their MySQL instance.
Of course, I won’t give him the “GRANT GRANT WITH GRANT OPTION” :-P, in that case I will simply give him root password :-P
As i didn’t find anything that solves my problem over Internet, I just did mine, as allways..
Here’s he result.
- Create a Mysql user with the following grants:
GRANT CREATE, RELOAD, SHOW DATABASES, CREATE USER ON *.* TO ‘database_creator’@’localhost’ IDENTIFIED BY ‘YOUR_PASSWORD’ ;
GRANT INSERT ON `mysql`.`db` TO ‘database_creator’@’localhost’ ;
- That will allow us to create databases, users, make some checks and reload privs, while we don’t create a new “root”…
You can download the script code from the wiki, also you’ll find additional information there.