Running MongoD Problem

Every time I run mongod it stops with “waiting for connections on port 27017” then nothing happens.

What should I do?

It is not error
Your mongod is up and running in foreground and waiting for connections
Please open another session and connect to mongo

Are you using vagrant or Windows?
In unix environments you can use --fork option to run mongod in background

2 Likes

Alternatively you can run the mongodb process in the background directly by adding the an ampersand at the end of your terminal commands.

Example

$ sudo mongod &

To review whats running in the background

$ jobs
$ [1]+ Running sudo mongod &

fg brings jobs to forground (your current situation)
bg pushes process to the background.

So from your specific scenario(having already started mongod) all you need to do is Ctrl+Z and then bg, pressing enter afterwards should bring back your terminal prompt.

GLHF!!

2 Likes

Thank you all
I am using windows so I don’t have --fork
however, $jobs add Ctrl+Z worked with me