User Tools

Site Tools


Sidebar

mongodb

Authentication

$ mongo
> db = db.getSiblingDB('admin')
> db.createUser({user: "username", pwd: "password", roles: ["userAdminAnyDatabase"]})

Add A FULL PRIVILEGED User (to unlock full functionality of RockMongo, etc)

$ mongo
> db = db.getSiblingDB('admin')
> db.createUser({user: "username", pwd: "password", roles: ["dbAdminAnyDatabase", "userAdminAnyDatabase", "readWriteAnyDatabase", "clusterAdmin"]})

References:

mongodb.txt · Last modified: 2017/01/06 07:47 by felixonmars