美文网首页
MacOS MongoDB Install and Start

MacOS MongoDB Install and Start

作者: Jacaranda2016 | 来源:发表于2018-07-13 12:07 被阅读4次

1. Download 

https://www.mongodb.com/download-center

2. PATH  (全路径)

3. Create Data path

默认在根目录下的data/db. 尝试过在mongodb中建立 data/db作为数据路径,但还是报错。

As you can see from the picture above, I have created a "data/db" folder in the mongodb folder but it did not work. 

4. Start MongoDB

As is shown below, the MongoDB server is started successfully.

命令总结:

# 添加全路径到PATH

~ export PATH=/Users/hannah/Develop/mongodb/bin:$PATH

# 创建数据路径

~ sudo mkdir -p /data/db

# 设置文件夹权限

~ sudo chown -R name /data

# 启动 MongoDB server

~ mongod

# 退出MongoDB

~ ctrl+C

相关文章

网友评论

      本文标题:MacOS MongoDB Install and Start

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