美文网首页我爱编程
MacOS 安装MongoDB

MacOS 安装MongoDB

作者: ROBIN2015 | 来源:发表于2017-06-13 19:44 被阅读31次

安装

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/

相关文章

网友评论

    本文标题:MacOS 安装MongoDB

    本文链接:https://www.haomeiwen.com/subject/hqljqxtx.html