1.利用homebrew 安装mongodb,打开终端,输入brew install mongodb安装的目录就是 /usr/local/Cellar/mongodb/
2.配置mongodb,在mongodb文件夹下建立data文件夹用来记录数据,log文件夹用来记录日志

3.从3.4.2文件夹进入到bin目录下创建mongodb.conf配置文件并且编写该文件在终端输入 vim mongodb.conf


4.启动mongodb ,在bin路径下执行./mongod -f mongodb.conf,成功后会打印 信息

网友评论