Mac下使用homebrew安装mongodb

首先去官网安装homebrew

使用homebrew安装mongodb,在MAC的终端中输入
brew install mongodb
若要查看安装信息
brew info mongodb

Last login: Wed Mar 14 10:44:09 on ttys004
➜  ~ brew info mongodb
mongodb: stable 3.6.0 (bottled)
High-performance, schema-free, document-oriented database
https://www.mongodb.org/
/usr/local/Cellar/mongodb/3.6.0 (19 files, 288.3MB) *
  Poured from bottle on 2018-03-14 at 10:13:13
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mongodb.rb
==> Dependencies
Build: go ✘, scons ✘
Recommended: openssl ✔
Optional: boost ✘
==> Requirements
Build: xcode ✔
Required: macOS >= 10.8 ✔
==> Options
--with-boost
	Compile using installed boost, not the version shipped with mongodb
--with-sasl
	Compile with SASL support
--without-openssl
	Build without openssl support
==> Caveats
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
➜  ~

启动
brew services start mongodb

停止
brew services stop mongodb

重启
brew services restart mongodb

(全文完)

(转载本站文章请注明作者和出处 Mac下使用homebrew安装mongodb