Created
August 10, 2021 02:54
-
-
Save PhongGCS/18fdb5d6afcd8052f721c56bc85ab094 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
/// Create new user have role owner with db | |
> mongo admin --username root --password <pwd> | |
> use prod | |
> db.createUser( | |
{ | |
user: "prod", | |
pwd: "<pwd>", | |
roles: [ { role: "dbOwner", db: "prod" } ] | |
} | |
) | |
> exit | |
/// Show db | |
> show dbs; | |
/// Restore a backup to db f8 | |
mongorestore --host 127.0.0.1 --username dbuser --password pass -d platform --port 27017 dbname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment