SocketException: Error connecting to

Hello, I’ve been trying run mongo through brew for a few days now, but I keep getting these error messages:

❯ mongo
MongoDB shell version v4.4.1
connecting to: mongodb://
Error: couldn’t connect to server, connection attempt failed: SocketException: Error connecting to :: caused by :: Connection refused :
exception: connect failed
exiting with code 1

every time I try running the brew services list, my mongodb-community status is “error”. Not sure how this can be fixed, please help!


Is your mongod up and running on port 27017?

Is the (greater than symbol>) your os prompt or are you already connected to mongo prompt and trying mongo command again?