Notice
Recent Posts
Recent Comments
Link
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Archives
Today
Total
관리 메뉴

3초 금붕어

맥북에서 오류없이 MongoDB(몽고디비) 설치부터 실행까지 본문

카테고리 없음

맥북에서 오류없이 MongoDB(몽고디비) 설치부터 실행까지

휘발성 메모리 2024. 5. 28. 22:29

-environments

Apple Slicon Mac OS

 

-tools

MongoDB Compass

Homebrew

 

0. Homebrew 설치(필요시)

Homebrew를 처음 쓰시는 분들은 설치 후 진행하기

맥북의 터미널에서 아래 명령어 입력

$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

설치 확인

$brew -v
Homebrew 4.3.1

 

 

1. mongodb-community

1-설치

맥북의 터미널에서 home brew를 통해 아래 명령어를 사용하여 설치하기

$brew install mongodb-community@7.0

 

2-설치 위치 확인

$brew --prefix

 

3-실행 및 종료

$brew services start mongodb-community@7.0
$brew services stop mongodb-community@7.0

 

4-실행 확인

$brew services list

 

5-연결

$mongosh 
Current Mongosh Log ID: 6651e11feb8aef4b4c461fe4
Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.6
Using MongoDB: 7.0.11
Using Mongosh: 2.2.6

For mongosh info see: https://docs.mongodb.com/mongodb-shell/
------
   The server generated these startup warnings when booting
   2024-05-25T21:59:35.944+09:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
------
Warning: Found ~/.mongorc.js, but not ~/.mongoshrc.js. ~/.mongorc.js will not be loaded.
  You may want to copy or rename ~/.mongorc.js to ~/.mongoshrc.js.

 

 

2. mongodb-compass

1-설치

brew install --cask mongodb-compass

 

2-실행

설치된 compass 실행

 

3-접속

mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.6

 

4-데이터 입력

 

 

-Reference Documents

https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/

https://brew.sh/ko/