I need two user accounts - both able to create and administer databases - but neither account able to access or administer databases created by the other account.

Is this possible?

1 Answer 1


Answer is NO. If user can create database what don't exists, user must have 'dbAdminAnyDatabase' role and then user can access any DB.

IF database names are know forehand, you can give 'dbAdmin' role to user for that database, even database don't actually exists yet. In this case, if those "prelisted" databases are different names, different users don't have right to those database what other users has created.

As you can create empty databases (without collections) forehand and give rights to users. But, DB names are "selected" forehand and user don't have possibility to choose their own DB name... Collections they can then create, if they have right to DB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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