Created
August 3, 2017 02:21
-
-
Save maxp/4990be5d5c4bd6f58cb6ec7c3f599bba to your computer and use it in GitHub Desktop.
MongoDB create admin and dbuser
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
use admin | |
db.createUser({user:'root',pwd:'ADMPASS',roles:['root']}) | |
mongo -u root -p ADMPASS localhost/admin | |
use MYDB | |
db.createUser({user:'MYUSER',pwd:'MYPASS',roles:['readWrite']}) | |
mongo -u MYUSER -p MYPASS localhost/MYDB | |
# mongodb.conf: | |
# security.authorization enabled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment