Why I can't connect to MongoDB? exception: connect failed

Posted December 9, 2016 23.8k views

When I type mongo it gives me error:

MongoDB shell version: 2.4.14
connecting to: test
Fri Dec  9 11:20:22.550 Error: couldn't connect to server at src/mongo/shell/mongo.js:145
exception: connect failed

When I start the project, it says that failed to connect to server [localhost: 27017]

I was working before but when another app was deployed to server (that also uses mongodb) it stopped working.

I installed mongodb again but no success. :(

Could anyone tell me what is the problem?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Are you seeing any indication of an error or issue in your log files? This would be the first place to start when checking if the service has failed for some reason. If you can share any errors or warnings showing up there we can better assist in troubleshooting.