Reputation: 6553
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
and when i type the below command also i am getting an error
guys i am clueless ,pls help me out
Upvotes: 0
Views: 360
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