通過homebrew
安裝mongodb
非常省事,但是如果沒有科學上網,可能比較慢,下面是官方安裝教程鏈接:
https://github.com/mongodb/homebrew-brew
主要步驟
1、brew tap mongodb/brew
2、brew install mongodb-community
3、啓動 brew services start mongodb-community
4、關閉 brew services stop mongodb-community