Last active
January 10, 2017 16:28
-
-
Save danhanfry/0372709b4683884c589fad505ac5a04e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mongoose: mongodb://username:password@host:port/database | |
$ mongo | |
> use admin | |
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
> exit | |
$ mongo | |
> use some_db | |
> db.createUser({user: "mongouser",pwd: "someothersecret",roles: ["readWrite"]}) | |
restart Mongod | |
mongod --auth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment