Skip to content

Instantly share code, notes, and snippets.

@passionsjin
Created December 10, 2020 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save passionsjin/95cee3649be5db84a6c7a2e3a8da459c to your computer and use it in GitHub Desktop.
Save passionsjin/95cee3649be5db84a6c7a2e3a8da459c to your computer and use it in GitHub Desktop.
MongoDB 활용
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