Fix MongoDB errno:61 Connection refused on OSX

I have just installed MongoDB thru homebrew, but I got this error when trying to open mongodb shell after the installation. Below is the error stracktrace.

MongoDB shell version: 3.2.6
connecting to: test
2016-05-29T22:57:35.930+0700 W NETWORK  [thread1] Failed to connect to, reason: errno:61 Connection refused
2016-05-29T22:57:35.931+0700 E QUERY    [thread1] Error: couldn't connect to server, connection attempt failed :

exception: connect failed

This error caused by the mongodb service not yet started. I fixed this by starting the service following this command.

$ brew services start mongodb


1 thought on “Fix MongoDB errno:61 Connection refused on OSX”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.