无法启动mongo db,initandlisten异常 [英] cant start mongo db , initandlisten exception

查看:97
本文介绍了无法启动mongo db,initandlisten异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试用mongod启动mongodb.这是我的错误信息:

I try to start mongodb with mongod. This is my error message:

我在initAndListen中存储[initandlisten]异常:29找不到数据目录/data/db.正在终止

I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating

因此,我尝试从mongodb文件夹(该文件夹包含一个包含data的文件夹,并且此文件夹中包含db)启动它,但仍然无法正常工作.它收到相同的错误消息.

So I tried to start it from my mongodb folder ( which has a folder with data , and this one has db in it) and still doesnt work. It got the same error message.

推荐答案

MongoDB需要一个数据目录来存储所有数据. MongoDB的默认数据目录路径是启动MongoDB的驱动器上的绝对路径\ data \ db.通过在命令提示符中运行以下命令来创建此文件夹

MongoDB requires a data directory to store all data. MongoDB’s default data directory path is the absolute path \data\db on the drive from which you start MongoDB. Create this folder by running the following command in a Command Prompt

md \ data \ db

md \data\db

例如,您可以使用mongod.exe的--dbpath选项为数据文件指定备用路径

You can specify an alternate path for data files using the --dbpath option to mongod.exe, for example

"C:\ Program Files \ MongoDB \ Server \ 3.4 \ bin \ mongod.exe" --dbpath d:\ test \ mongodb \ data

"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --dbpath d:\test\mongodb\data

如果您在Windows上工作,那么对我来说,最好的链接是

If you are working on windows then for me the best link to follow is

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/

,对于此链接内安装"类别中给出的Linux和OS X,也是如此.

and same for Linux and OS X given inside Installation category within this link.

这篇关于无法启动mongo db,initandlisten异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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