Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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 have user "U" who I want to give him full access to all the existing databases except "db1". I want him to only have select privilege for that db. What I did is I gave "U" all permissions for each db one by one and select permission on "db1". What I want to do is to give "U", the create database privilege and full access to any created database by him. Is there anyway that I could do it? I don't want to add privileges every time someone creates a db.

share|improve this question
Same as [this][1] on stackoverflow, some answers there [1]:… – geermc4 Sep 18 '12 at 17:42
could you edit the "this"? its not a link. thanx – AliBZ Sep 18 '12 at 17:44
Hmm, it was when i posted it as a answer but it converted to a comment, anyways the link was ment to point to that stackoverflow link at the end – geermc4 Sep 18 '12 at 17:54

It is impossible to do this using permissions only .

The only way is to create a stored procedure as described here

If you want to avoid stored procedures, a workaround is: GRANT ALL PRIVILEGES ONtestuser_%. * TO 'testuser'@'%'; (as suggested here); however, this has the problem that the users must then be very careful in naming their databases.

For example if user aaa creates database bbb_xyz, it can then be accessed exclusively by user bbb but not by user aaa.

share|improve this answer

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.