MongoDB中不工作。 "错误:DBPATH(/数据/ DB)不存在" [英] MongoDB not working. "ERROR: dbpath (/data/db) does not exist."

查看:347
本文介绍了MongoDB中不工作。 "错误:DBPATH(/数据/ DB)不存在"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误,当我尝试在终端中运行的mongod。我试着卸载,重新安装,并重新启动机器。如何得到它的工作任何建议将是惊人的。

I'm getting the following error when I try to run "mongod" in the terminal. I've tried uninstalling, reinstalling, and restarting the machine. Any suggestions on how to get it working would be amazing.

ERROR:

dbpath (/data/db) does not exist.
 Create this directory or give existing directory in --dbpath.
 See http://dochub.mongodb.org/core/startingandstoppingmongo

附注:
节点也停止了我的机器上工作大约在同一时间,我得到这个错误。

Side note: Node also stopped working on my machine around the same time that I got this error.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: failed to connect to [localhost:27017]

任何帮助将是非常美联社preciated!

Any help would be much appreciated!

推荐答案

这应该工作,确保目录是建立在正确的地方,这样蒙戈可以找到它:

This should work to ensure that the directory is set up in the right place so that Mongo can find it:

须藤的mkdir -p /数据/ DB /

须藤CHOWN`ID -u` /数据/ DB

这篇关于MongoDB中不工作。 "错误:DBPATH(/数据/ DB)不存在"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆