MongoDB
[Mac] Homebrew를 통해 MongoDB 설치하기
포시
2022. 12. 13. 15:02
728x90
1. Homebrew 설치
터미널을 실행한 후 아래 코드를 통해 homebrew를 설치
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
에러해결법
위 코드를 그대로 입력했는데 이런 에러가 뜬다면 여기서 안내하는 방법을 그대로 따라해준다.
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
(저장소 위치에 따라 위 코드는 달라질 수 있다.)
unshallow 완료가 되면 다시 맨 위에서 안내한 코드를 입력한다.
homebrew 설치 완료
2. MongoDB 설치
brew tap mongodb/brew
brew install mongodb-community
한줄씩 실행
3. MongoDB 실행
brew services start mongodb-community
4. 실행 확인
http://localhost:27017로 접속 시 아래와 같은 화면이 나온다면 잘 된 것!
728x90