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!
Try with apostrophes " :
"
mongod.exe --config "C:\Program Files\mongodb\bin\mongo.cfg"
This probably means a space in the phrase "Program Files"
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
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"