Connect ECONNREFUSED 127.0.0.1:27017 in Mongodb Compass

I am not an expert, just another user, but I believe this set of steps could help you

Upon start it seems to me that Mongodb server generates a lock that blocks another process to take that port (this may be fully false).

Test this ls /tmp/mongodb-27017*, because it is a temporary file you can very well remove it.

Then restart the server, and see if it connects.

2 Likes