直接使用brew install mongodb现在好像无法安装了.
需要使用以下方法:
brew tap mongodb/brew
brew install mongodb-community
安装完成后,以下为输出内容:
brew install mongodb-community
Updating Homebrew...
==> Installing mongodb-community from mongodb/brew
==> Downloading https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.1.tgz
######################################################################## 100.0%
==> Caveats
To have launchd start mongodb/brew/mongodb-community now and restart at login:
brew services start mongodb/brew/mongodb-community
Or, if you don't want/need a background service you can just run:
mongod --config /usr/local/etc/mongod.conf
==> Summary
🍺 /usr/local/Cellar/mongodb-community/4.2.1: 21 files, 273.5MB, built in 27 minutes 38 seconds
启动mongodb:
brew services start mongodb-community
停止mongodb:
brew services stop mongodb-community
如果brew没有,以下命令安装:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"