Homebrew官網:http://brew.sh
Homebrew installs the stuff you need that Apple didn't
Homebrew的安裝非常簡單,打開終端複制、粘貼以下指令。
2.如果你目前的環境變量還沒有加入 mongod ,手動添加的環境變量中.
$ nano ~/.bash_profile
//添加mongodb安裝目錄到環境變量中
export PATH=/usr/local/Cellar/mongodb/3.4.0/bin/:$PATH
3.如果讓環境變量馬上生效? 執行下面的
shell source ~/.bash_profile