我爱编程

MacOS 安装MongoDB

2017-06-13  本文已影响31人  ROBIN2015

安装

1. Update Homebrew’s package database.

brew update

2. Install MongoDB

brew install mongodb

3. Install the MongoDB Binaries with TLS/SSL Support

brew install mongodb --with-openssl

4. Install the Latest Development Release of MongoDB

brew install mongodb --devel

运行

1. Create the data directory

mkdir -p /data/db

2. Set permissions for the data directory

Before running mongod for the first time, ensure that the user account running mongod has read and write permissions for the directory.

3. Run MongoDB

mongod

Specify the path of the data directory

If you do not use the default data directory (i.e.,/data/db), specify the path to the data directory using the--dbpath option

mongod --dbpath  <path to data directory>

参见: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

上一篇 下一篇

猜你喜欢

热点阅读