使用brew安装
brew install mongodb
添加环境变量
vim .base_profile
export MONGO_PATH=/usr/local/mongodb
export PATH=$PATH:$MONGO_PATH/bin
启动mongodb服务端
mongod --config /usr/local/etc/mongod.conf
重新开启一个终端
mongo
brew install mongodb
vim .base_profile
export MONGO_PATH=/usr/local/mongodb
export PATH=$PATH:$MONGO_PATH/bin
mongod --config /usr/local/etc/mongod.conf
mongo