Mobin Ranjbar
Mobin Ranjbar

Reputation: 1360

MongoDB Error: couldn't connect to server

I have a problem for a month and I did not find a solution.Both my laptop and PC have these problems(I started mongod before):

Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91 exception: connect failed

Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:93 exception: connect failed

Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:L112 exception: connect failed

I have started the mongod process without any parameter.And also I have a reply message by pinging 127.0.0.1

By the way I use windows os and It does not have any permission issue. In addition I started the data directory from scratch but did not work. (There is no error in mongod's log file)

Any help ?

Upvotes: 1

Views: 11772

Answers (3)

Naresh Chary
Naresh Chary

Reputation: 21

open your task manager.. click on services.. find mongodb and right click on it... click on start... bhoom your problem is resolved.. open cmd and check it

Upvotes: -1

Seth Kniceley
Seth Kniceley

Reputation: 101

I received this error because I accidentally ran "mongo.exe" instead of "mongod.exe". So, of course, Mongo complained that it had no database to connect to. ;)

Upvotes: 8

Mobin Ranjbar
Mobin Ranjbar

Reputation: 1360

Oops! My problem is solved.The problem was a software called "Proxifier" that blocked my localhost.I closed it and It worked properly.

Upvotes: 0

Related Questions