Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start mongodb

I'm trying to install mongodb on my window 7 machine. When trying to start it by using the mongod command I get this error. dbpath (\data\db) does not exist. I followed the steps ath the tutorial. All the folders exist C:\mongodb\log, C:\mongodb\data and C:\mongodb\data\db . enter image description here

like image 913
Antarr Byrd Avatar asked Jun 05 '13 01:06

Antarr Byrd


People also ask

Why MongoDB is not opening?

In short, the problem of starting MongoDB server when running the command mongod may arise due to file permission or ownership issues.

How do I start MongoDB?

You can start MongoDB from a command line by issuing the mongod command and specifying options. For a list of options, see the mongod reference. MongoDB can also run as a Windows service. For details, see Start MongoDB Community Edition as a Windows Service.

Why is my MongoDB shutting down?

the MongoDB shutting down with code:100 Error Due to Incorrect File Permissions. One main reason for this error is incorrect file permissions. This problem occurred due to either a permission issue with the data files or the inability to find the desired file location.


2 Answers

The default path is c:\data\db. You are trying to use c:\mongodb\data\db.

This means you have to use the option --dbpath c:\mongodb\data\db for mongod command.

like image 51
Asya Kamsky Avatar answered Sep 21 '22 21:09

Asya Kamsky


By default, when we start the mongodb, it looks for the folder /data/db (on Mac/Linux) or C:\data\db (on windows)...however, during the installation it doesn't create this folder, so when when we run mongodb for the first time, it fails with the error that it can't find C:\data\db folder. The solution is to manually create C:\data\db folder and then start mongodb. This error can be totally avoided if the mongodb installer can just give an option to choose this folder path and then create it as part of mongodb installation itself.

like image 41
Shireesh Thanneru Avatar answered Sep 20 '22 21:09

Shireesh Thanneru