Tag Archives: net start MongoDB

Net start mongodb error: invalid service name

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Solution

1. check your configuration information first. If everything is correct, open CMD in administrator mode instead of directly

2. and then jump to the bin directory of mongodb in CMD. My example is:

cd "C:\Program Files\MongoDB\Server\3.4\bin"

3. then the CMD is written to the service

mongod --dbpath  "D:\MongodbData\data"  --logpath "D:\MongodbData\logs\mongodb.log" --install --serviceName "MongoDB"

4. finally, start the service

net start MongoDB

5. after opening, you can simply test whether it is enabled or not
Enter in the browser http://127.0.0.1 :27017, If it looks like you are trying to access mongodb over HTTP on the native driver port. is displayed, it will be opened successfully


or go to the computer management page to check whether it is opened