Last active
May 6, 2017 14:45
-
-
Save navopw/cec323e6810f433ae1bf2c25338f9b5d to your computer and use it in GitHub Desktop.
MongoDB: How to add admin user & database user
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: "<username>", | |
pwd: "<password>", | |
roles: [ | |
"userAdminAnyDatabase", | |
"dbAdminAnyDatabase", | |
"readWriteAnyDatabase" | |
] | |
}) | |
use databasename | |
db.createUser({ | |
user: "databasename", | |
pwd: "<password>", | |
roles: [ | |
{ role: "readWrite", db: "databasename" } | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Look at the revisions, I posted the database password for pllx.eu 🤣
You dont have to try it, I changed it 👍