0

Ubuntu 16.04

console output for running mongo on the terminal:

MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
2018-03-27T18:23:41.006+0530 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-03-27T18:23:41.006+0530 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed
kaushal agrawal
  • 360
  • 3
  • 21

2 Answers2

0

This answer by @CodeGench helped resolve my problems. Before doing it, I already tried uninstalling and reinstalling and all sorts of things which didn't work.

kaushal agrawal
  • 360
  • 3
  • 21
0

User This Command

sudo systemctl start mongod

Then

mongo
Mehedi Setu
  • 119
  • 1
  • 3