Skip to content

Instantly share code, notes, and snippets.

@gilfernandes
Created February 21, 2017 15:23
Show Gist options
  • Save gilfernandes/7934c7d464e85ac0cf5d27c9737a81de to your computer and use it in GitHub Desktop.
Save gilfernandes/7934c7d464e85ac0cf5d27c9737a81de to your computer and use it in GitHub Desktop.
use admin
db.createUser( { user: "admin",
pwd: "************",
roles: [ "userAdminAnyDatabase",
"dbAdminAnyDatabase",
"readWriteAnyDatabase"
] } )
use dqdict
db.createUser( { user: "dqdict-user",
pwd: "****************",
roles: [ { role: "readAnyDatabase", db: "admin" },
"readWrite"] },
{ w: "majority" , wtimeout: 5000 } )
use tds
db.createUser( { user: "tds-user",
pwd: "********************",
roles: [ { role: "readAnyDatabase", db: "admin" },
"readWrite"] },
{ w: "majority" , wtimeout: 5000 } )
@gilfernandes
Copy link
Author

How to create users in MongoDB for two users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment