Mongo: Couldn’t connect to server

Python Zac 3 years ago (2018-02-14) 8171 views 0 comments


MongoDB shell version v3.6.0
connecting to: mongodb://
2018-02-14T13:33:47.147+0800 W NETWORK [thread1] Failed to connect to after 5000ms milliseconds, giving up.
2018-02-14T13:33:47.148+0800 E QUERY [thread1] Error: couldn’t connect to server, connection attempt failed :
exception: connect failed

MongoDB connect to server failed


How to fix:

Occurred this error because you did not open the MongoDB server.

Open MongoDB server: mongod –dbpath “your MongoDB data folder path”


My situation:

MongoDB data folder


In my situation, just type: mongod –dbpath “D:\MongoDB\Server\3.6\data”

fix Mongodb error


It works!

Hope this is helpful to you. If you have any questions, please comment it. I will reply you as soon as possible.

Like (19)
Cancel comment

emoji Image Bold Strilethrough Center Italic

Your email and address

  • Name (Required)
  • Email (Required)
  • Website(Optional)