Question

I just fired up mongod.exe for my first time. However, I accidentally closed the command prompt and now I can't figure out how to kill the DB server process. I tried connecting via mongo.exe but I'm getting following error:

exception: connect failed

How do I stop the server process?

Was it helpful?

Solution

If you started mongod.exe via a command prompt in Windows:

> mongod

And then you closed that command window, the process will automatically be terminated. It is not running any more.

The error you're receiving when running mongo.exe is because MongoDB is not running. You'll need to run mongod.exe again if you need to access the database with the console via mongo.exe

You may want to consider setting MongoDB up as a service on Windows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top