When installed for the first time, there is no access control by default. To activate it, one must connect to the unprotected instance and create a new admin user like this:
db.createUser( { user: "myUserAdmin", pwd: passwordPrompt(), // or cleartext password roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ] } )
Then restart the mongo process, either through the command line or
db.adminCommand( { shutdown: 1 } )
Comments
Post a Comment