Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Web Technology by (50.2k points)

With the help of Homebrew, I have  installed mongodb-2.6.0 . I have successfully installed the MongoDB server. Then I have tried to connect using the mongo command but I am getting the following errors:

Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused

Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146

exception: connect failed

1 Answer

0 votes
by (108k points)

The error that you are getting will appear when the mongodb service is not connected or you can say started on the mac. So for starting the server, you have to implement the following code:

brew services start mongodb

and it will work...

Browse Categories

...