Hi All, this document deals with to add a user in MongoDB with root role. This user will have the super admin access over the admin database to perform all admin related activities.

Step 1: Login to mongo shell.

mongo

Step 2: create a user with root role.

db.createUser(
{
user: 'adminuser',
pwd: 'yourpassword',
roles: [ { role: 'root', db: 'admin' } ]
}
);

© 2019, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

0 Comments

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.