우노
[MongoDB] Create User 본문
admin db 사용
use admin
유저 생성
db.createUser( { user: "user", pwd: "password", roles: [ { role: "userAdminAnyDatabase", db: "admin" }, { role: "dbAdminAnyDatabase", db: "admin" }, { role: "readWriteAnyDatabase", db: "admin" } ], mechanisms:[ "SCRAM-SHA-1" ] } )
유저 확인
db.getUsers()
'Database > MongoDB' 카테고리의 다른 글
[MongoDB] mongoimport (0) | 2020.07.03 |
---|---|
[MongoDB] Index (0) | 2020.07.02 |
[MongoDB] Delete Collection (0) | 2020.07.02 |
[MongoDB] Delete Database (0) | 2020.07.02 |
[MongoDB] Docker MongoDB Install (0) | 2020.07.02 |
Comments