yasarui
yasarui

Reputation: 6553

Not able to start MongoDB

I have installed MongoDB in the C drive. the bin folder is in the below path. i have also created the data and log folders.within the data folder have created a folder named db

C:\Program Files\MongoDB\Server\3.4\bin

i have opened the cmd and navigated to the bin folder and type the below command

mongod --directoryperdb --dbpath C:\Program Files\MongoDB\Server\3.4\data\db --logpath C:\Program Files\MongoDB\Server\3.4\log\mongo.log --logappend --rest --install

i am getting the below error

enter image description here

and when i type the below command also i am getting an error

enter image description here

guys i am clueless ,pls help me out

Upvotes: 0

Views: 360

Answers (1)

Anirudh Bagri
Anirudh Bagri

Reputation: 2447

can you try this:

mongod --directoryperdb --dbpath "C:\Program Files\MongoDB\Server\3.4\data\db" --logpath "C:\Program Files\MongoDB\Server\3.4\log\mongo.log" --logappend --rest --install

The error can be because of the space between "Program Files".

For the second error, it is because MongoDB is not installed as a service. You can check you this answer to see how to setup mongo as a service.

Upvotes: 2

Related Questions