0.確保mac已經安裝了HomeBrew (macos的包管理工具安裝方式:終端執行 ruby -e "$(curl -fsSLhttps://raw.github.com/mxcl/homebrew/go)" 別落下最后一個引號)
1.終端執行執行:brew install mongodb 等待幾分鍾 即可自動下載並安裝 mongoBD
2.安裝 成功后會顯示
To have launchd start mongodb now and restart at login: brew services start mongodb Or, if you don't want/need a background service you can just run: mongod --config /usr/local/etc/mongod.conf
3.啟動mongodb服務:終端執行: brew services start mongodb
注:使用brew 默認下載地址為 /usr/local/Cellar/ 下的 mongodb文件夾。 打開finder直接前往 /usr/local/Cellar/ 即可。