一、brew update更新慢和失败的问题解决
sudo chown -R $(whoami):admin /usr/local
cd $(brew --prefix) && Git fetch origin && git reset --hard origin/master

二、update
brew update

三、安装mongo
brew install mongodb

四、建立data和log目录
mkdir /usr/local/opt/mongodb/data
mkdir /usr/local/opt/mongodb/log/
export LC_ALL=C

mongod -dbpath "/usr/local/opt/mongodb/data" -logpath "/usr/local/opt/mongodb/log/mongodb.log"

五、连接数据库
mongod



09-22 22:38