question
Install Mongodb on the E disk, and then enter it through cmd
mongod --dbpath E:\MongoDB\data
You can start mongodb, but check the service, but found that the MongoDB service has not started. Moreover, it is very strange that
the service is manually started and an error is reported . Of course, in this case, use
net start mongodb
net stop mongodb
The mongodb service cannot be started.
Solution
I thought, since there is a MongoDB service by default, let me take a look at its properties first.
It can be seen that when mongodb is started, the configuration "E:\MongoDB\bin\mongod.cfg" is enabled. Next, check what configuration is in it. Is there any
problem with this configuration? Why is the execution unsuccessful?
Later, I was lucky enough to see this article `https://blog.csdn.net/qq_20084101/article/details/82261195
to know what is going on. It turns out that when mongodb is installed on a non-system disk, the last line of this configuration file will be one more line of code
mp:
Comment out this line of code and find that the problem is solved!
Turning on and off the service manually is also OK.