Andrii Pryimak
Andrii Pryimak

Reputation: 817

Error reading config file. MongoDB

I'm installing MongoDB by official tutorial, but I have an error in command prompt:

Error reading config file: No such file or directory

This error happens when I try to start MongoDB with this command:

mongod.exe --config C:\Program Files\mongodb\bin\mongo.cfg

Help pls!

Upvotes: 5

Views: 19206

Answers (3)

tylerjgarland
tylerjgarland

Reputation: 643

Changing to double quotes fixed the issue for me. I was trying to install mongo on Windows Server 2016.

mongod.exe --config 'C:\Program Files\MongoDB\Server\3.4\bin\mongod.cfg'

VS

mongod.exe --config "C:\Program Files\MongoDB\Server\3.4\bin\mongod.cfg"

Upvotes: 1

OuuCchhh
OuuCchhh

Reputation: 71

I realized that in my case the explorer was hidding the ".txt" extension. Once I deleted the .txt it worked perfectly. The same happened with the .cfg file

Upvotes: 6

user2941651
user2941651

Reputation:

Please try with the apostrophes ":

mongod.exe --config "C:\Program Files\mongodb\bin\mongo.cfg"

Probably its beacuse of space in phrase "Program Files"

Upvotes: 8

Related Questions