How To Solve Mongo - couldn't connect to server 127.0.0.1:27017 error?

Problem:
[js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:257:13
@(connect):1:6

Solution
Normally this caused because you didn't start mongod process before you try starting mongo shell.

Start mongod server
 mongod
Open another terminal window and start mongo shell
 mongo

Comments

Popular Posts