How to fix Connection error (MongoSocketOpenException): Exception opening socket

I am trying to machine for development 
Error while Connecting to Local Mongo Database

Connection failed.

SERVER [localhost:27017] (Type: UNKNOWN)
|_/ Connection error (MongoSocketOpenException): Exception opening socket
|____/ Socket error: Connection refused: connect

Issue:
MongoSocketOpenExceptions on Windows local mongo connection

Unable to bindIp and port

Solution:

  • Make sure MongoDB is installed on Machine
  • Open file mongod.cfg `C:\Program Files\MongoDB\Server\5.0\bin\mongod.cfg`
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1

Comments