mongodb 2019消息,不再開源,因此只能安裝社區版本
brew tap mongodb/brew
brew install mongodb-community
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
配置文件
/usr/local/etc/mongod.conf
啟動服務端
brew services start mongodb/brew/mongodb-community
mongod --config /usr/local/etc/mongod.conf
啟動客戶端
mongo
常見命令:
show dbs;
use admin;
關閉服務
db.shutdownServer();
參考
https://github.com/mongodb/homebrew-brew
https://juejin.im/post/5d9d7ad66fb9a04e373163c3
https://www.runoob.com/mongodb/mongodb-osx-install.html