MacOS 安装MongoDB

安装

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/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Mac MongoDB安装 一、安装 MongoDB的安装方法有很多,本文以官方文档中的两种方法为准。 1. 手动...
    Keriy阅读 16,746评论 2 7
  • 安装Homebrew Homebrew是Mac OSX下一个包依赖管理工具,用它来安装软件非常的方便只需要brew...
    liu_bo阅读 491评论 0 2
  • NoSql数据库优缺点 在优势方面主要体现在下面几点: 简单的扩展 快速的读写 低廉的成本 灵活的数据模型 在不足...
    dreamer_lk阅读 2,770评论 0 6
  • 不开心
    洁洁姐姐吃吃吃阅读 142评论 0 0
  • 佩奇排名(PageRank),又称网页排名、谷歌左侧排名,是一种由搜索引擎根据网页之间相互的超链接计算的技术,而作...
    Nicky_Ye阅读 21,083评论 1 12