Created
December 10, 2020 12:14
-
-
Save passionsjin/95cee3649be5db84a6c7a2e3a8da459c to your computer and use it in GitHub Desktop.
MongoDB 활용
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
sudo apt-get install mongodb-clients | |
mongo --host {host} -u admin -p --authenticationDatabase admin | |
27017 | |
1. 계정 생성하기 | |
db.createUser({user: "계정이름", | |
pwd: "비밀번호", | |
roles:["dbAdminAnyDatabase", "readWrite", "userAdmin"] | |
}) | |
데이터베이스마다 user를 생성. | |
> db.createUser({user: "test_user_1", pwd: "userpww", roles: ["readWrite"], mechanisms:["SCRAM-SHA-1"]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment