Cannot connect to the MongoDB at localhost:27017



Cannot connect to the MongoDB at localhost:27017.


Error:



Network is unreachable. Reason: couldn't connect to server localhost:27017, connection attempt failed: SocketException: Error connecting to localhost:27017 (127.0.0.1:27017) :: caused by :: No connection could be made because the target machine actively refused it.



We get this error, if mongodb is unreachable means not running in our machine.

In Windows:
To start a MongoDB service that is in stop mode, please follow those steps.
  1. Press window key + R to open Run window.
  2. Then type "services.msc" to open services window.
  3. Then select MongoDB server, right click on it, finally click on the start menu entry.






Previous Post Next Post