IT/javascript

[macOS] MongoDB 설치하기 (유튜브 클론 6.7)

공장장J 2022. 9. 16. 01:05
반응형

MongoDB

  • document - based 문서기반 데이터베이스
  • 일반적인 데이터베이스는 문서기반이 아닌 sql베이스 (엑셀같은 열과 행)
  • 문서기반 데이터베이스는 데이터베이스를 object처럼 생각함.
  • Json-like-document

 

 

 

macOS에 MongoDB 설치하기

mongo.com -> Resources -> Server -> Installation -> Community Edition(무료) -> mac 터미널에 복붙 과정(아래 추가설명)

 

MongoDB 무료버전 Community Edition 설치 과정 (3단계)

차례대로 터미널에 복붙하면 된다.

1.

xcode-select --install

2.

brew tap mongodb/brew

3.

brew install mongodb-community@6.0

 

진행하다 에러를 만났다면 아래 링크를 참고해주세요.


설치 중 만난 에러 1. 해결방법

2022.09.15 - [IT/개발] - [에러해결] xcode-select: error: command line tools are already installed, use "Software Update" to install updates / Xcode 업데이트 하는 방법


설치 중 만난 에러 2. 해결방법

2022.09.15 - [IT/개발] - Error: homebrew-core is a shallow clone. 에러 MongoDB 설치 에러 해결하기.

 

 

 

MongoDB 설치 완료, 설치 확인하기


 

터미널에 mogod 입력.

mongod //설치확인

 

MongoDB 연결 에러 해결 및 설치 성공 확인하기

2022.09.16 - [IT/개발] - MongoDB설치 에러 exception: connect failed 해결하고 설치 성공 확인하기

 

MongoDB설치 에러 exception: connect failed 해결하고 설치 성공 확인하기

mongodb를 설치하면서 2개의 에러를 넘어 여기까지 왔는데. mongod 까지도 괜찮았어. 그리고 이제 mongodb shell과 연결하기 위해 mongo라고 입력했는데. exception: connect failed 연결실패?!!!!! j맥북 $ mon..

rootingforme.tistory.com

 

에러를 만났다면 위 링크를 참고해주고. 에러 없이 연결이 잘 되었다면 아래와 같은 코드를 볼 수 있을 거다.

j맥북$ mongo
MongoDB shell version v4.0.0
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 4.0.0
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
	http://docs.mongodb.org/
Questions? Try the support group
	http://groups.google.com/group/mongodb-user
Server has startup warnings: 
2022-09-16T00:24:59.703+0900 I CONTROL  [initandlisten] 
2022-09-16T00:24:59.704+0900 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2022-09-16T00:24:59.705+0900 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2022-09-16T00:24:59.705+0900 I CONTROL  [initandlisten] 
2022-09-16T00:24:59.706+0900 I CONTROL  [initandlisten] 
2022-09-16T00:24:59.707+0900 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
---
Enable MongoDB's free cloud-based monitoring service to collect and display
metrics about your deployment (disk utilization, CPU, operation statistics,
etc).

The monitoring data will be available on a MongoDB website with a unique
URL created for you. Anyone you share the URL with will also be able to
view this page. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.

To enable free monitoring, run the following command:
db.enableFreeMonitoring()
---

>

 

mongodb 내부에서 명령어도 확인하고 명령어도 입력이 가능하다면 설치가 성공적으로 완료된 것이다.

help 라는 명령어를 쓰면 mongodb가 알아들을 수 있는 명령어와 설명이 나온다.

 

show dbs 명령어는 데이터베이스를 보여준다.

 

위 명령이 가능했다면 MongoDB 설치는 성공적으로 완료된 것이다.

반응형