Error reading configuration file. MongoDB

I am installing MongoDB from the official tutorial, but I have a command line error:

Config file read error: no such file or directory

This error occurs when I try to start MongoDB using this command:

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

Pls help!

+3


source to share


3 answers


Try with apostrophes "

:

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

      



This probably means a space in the phrase "Program Files"

+3


source


I realized that in my case the researcher was hiding the ".txt" extension. Once I removed the .txt it worked fine. The same happened with the .cfg file



+4


source


Changing the double quotes fixed the problem 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"

+1


source







All Articles