1. mongosh 다운로드
Welcome to MongoDB Shell (mongosh)
Welcome to MongoDB Shell (mongosh) - MongoDB Shell
The MongoDB Shell , mongosh, is a JavaScript and Node.js REPL environment for interacting with MongoDB deployments in Atlas , locally, or on another remote host. Use the MongoDB Shell to test queries and interact with the data in your MongoDB database. Dow
www.mongodb.com
2. mongosh 파일 bin위치로 이동
3. mongosh 접속
mongosh
4. admin 테이블 사용
use admin
5. root 권한 사용자 생성
db.createUser(
{
user: "root",
pwd: "1234",
roles: [
// 슈퍼 유저 권한
{ "role" : "readWriteAnyDatabase", "db" : "admin" },
{ "role" : "userAdminAnyDatabase", "db" : "admin" },
{ "role" : "dbAdminAnyDatabase", "db" : "admin" },
{ "role" : "clusterAdmin", "db" : "admin" },
{ "role" : "restore", "db" : "admin" },
{ "role" : "backup", "db" : "admin" }
]
}
)
6. 사용자 검색
db.getUsers()
7. 사용자 삭제
db.dropUser("삭제할아이디")
'삽질' 카테고리의 다른 글
서비스 지향 아키텍처(SAO) 특징과 MSA와의 차이점 (0) | 2024.08.06 |
---|---|
Java 버전 별 주요 Features (0) | 2024.07.23 |
Feign Client Decode Exception (0) | 2024.05.26 |
@EnableBatchProcessing 사용시 설정 Back Off (0) | 2024.05.04 |
UnsupportedProductError The client noticed that the server is not a supported distribution of Elasticsearch (2) | 2024.03.14 |