몽고쉘 연결 & 인증
몽고쉘 Atlas/로컬 연결, admin 계정 인증 방법 정리.
몽고쉘 연결
Atlas 클러스터 연결은 아래처럼.
mongosh "mongodb+srv://cluster0.eonroyn.mongodb.net/[DB이름]" --apiVersion 1 --username [유저이름] --password [비밀번호]
[DB이름]:myFirstDatabase대신 실제 디비 이름으로 바꿔 넣기.[비밀번호]:--password뒤에 실제 암호 바로 입력하면 됨.
로컬 몽고쉘은 그냥 mongosh 치면 접속.
admin 계정 로그인
use admin
db.auth("[아이디]","[비밀번호]")
[아이디]랑 [비밀번호]는 실제 계정 정보로.
여기서 배울 것
- Atlas 몽고쉘 연결 URI 구조 파악.
- --password 플래그로 암호 바로 입력 가능.
- 로컬 몽고쉘 접속은 `mongosh`로 퉁침.
- admin 계정 인증은 `use admin` 후 `db.auth`로.
원본 파일 보기 (.claude/skills/tn-mongo-shell-connection/SKILL.md)
---
name: MongoDB Shell 연결 및 인증
description: This skill should be used when the user asks to connect to a MongoDB shell, including MongoDB Atlas clusters, or needs to authenticate an admin account within the `mongosh` environment.
version: 1.0.0
source: /home/son/prj/resume/backup_notes_260317/notion/Tech Note/몽고쉘 연결 f4e0f9b0b2eb4b7d8d5b9056ae07b204.md
---
# 몽고쉘 연결

connect- mongo shell

mongosh "mongodb+srv://cluster0.eonroyn.mongodb.net/myFirstDatabase" --apiVersion 1 --username urustin
myfirstdatabase를 디비 이름으롭 바꾸고
뒤에 —password 쳐서 실제 암호로 입력
mongosh "mongodb+srv://cluster0.eonroyn.mongodb.net/db_menu" --apiVersion 1 --username urustin --password asdf1234
AWS Installed

just put “mongosh”
**login to admin account**

`use admin`
`db.auth(”id”,”pwd”)`