0
votes

when I'm trying to open mongodb with command prompt I'm getting a error message like

D:\mongo-bd\bin>mongo.exe MongoDB shell version v3.6.4 connecting to: mongodb://127.0.0.1:27017 2018-04-27T18:50:28.340+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1 :27017 after 5000ms milliseconds, giving up. 2018-04-27T18:50:28.340+0530 E QUERY [thread1] Error: couldn't connect to ser ver 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:251:13 @(connect):1:6 exception: connect failed

I have tried by running mongo --repair command but still I'm facing this problem.

1
Check if there's mongod running (cmd>tasklist). Then if the tcp/27017 port is listening (cmd>netstat)Vicctor
yes i have seen in the tasklist there is mongod in the listuser9705886
And how about port? call cmd> netstat -aVicctor

1 Answers

0
votes

1 First set up the data directory - google it

2 then run the

{installationDirectory}/MongoDB/Server/{serverVersion}/bin/mongod.exe
to start the service

3 Get into the shell

{installationDirectory}/MongoDB/Server/{serverVersion}/bin/mongo.exe