otwol
asked Aug 13 2019
edited Aug 19 2019
Answer
Login in to the MongoDB server
$ mongo
use admin;
db.createUser( { user:"user1", pwd:"password", roles:[{role:"root",db:"admin"}] } ) exit
Connect to the MongoDb server using the user1 credentials$ mongo -u user1 -p --authenticationdatabase admin
Enter the Password of the user that you have set and get connected to the mongoDb server.
linuxhelp
asked Aug 14 2019
How to create an Admin user in MongoDB
Hello,I just want to create a user who should have the admin privileges in MongoDb ?What is the format