Created
January 10, 2017 07:42
-
-
Save iworkforthem/fbcf488571db22e70fa787c223fa2024 to your computer and use it in GitHub Desktop.
MongoDB Shell create user.
This file contains hidden or 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: "", | |
pwd: "", | |
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] | |
} | |
) | |
mongo --port 27017 -u "" -p "" --authenticationDatabase "" | |
db.copyDatabase('admin','') | |
db.createUser({ | |
user: "", | |
pwd: "", | |
roles: [{ role: 'readWrite', db:''}] | |
}) | |
mongo --port 27017 -u "" -p "" --authenticationDatabase "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment