Last active
September 9, 2017 23:18
-
-
Save scizers/ee546c833111ab15f109 to your computer and use it in GitHub Desktop.
add admin user to mongodb
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: "admin", | |
pwd: "alum123#", | |
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] | |
} | |
) | |
db.createUser( | |
{ | |
user: "root", | |
pwd: "1234556#", | |
roles: [ "root" ] | |
} | |
) | |
mongodump --db nextcampus | |
mongorestore dump | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment