0

I'm beginner in Mongodb.Im using mongo version 4.0.2. I have been working in mongodb Past few days.past two three days It has been worked fine.suddenly my system updated.After that I could not run mongodb in localhost.

If i execute mongod in cmd.**I have gotten **" shutting down with code:62" enter image description here If I execute mongo in cmd.**It shows **connect@src/mongo/shell/mongo.js:257:13 @(connect):1:6 exception: connect failed.I have attached the pic .Anyone can resolve this problem.Thanks in advance... enter image description here

demo developers
  • 161
  • 4
  • 18
  • May be the case: https://stackoverflow.com/questions/13312358/mongo-couldnt-connect-to-server-127-0-0-127017/53635485#53635485 – Blasanka Jan 25 '19 at 14:32
  • Possible duplicate of [mongo - couldn't connect to server 127.0.0.1:27017](https://stackoverflow.com/questions/13312358/mongo-couldnt-connect-to-server-127-0-0-127017) – Blasanka Jan 25 '19 at 14:33

2 Answers2

1

Go in the main c:/ drive and check if the folder exists with the name of data if not

  • Go to root directory that is c:/ in case of windows
  • create folder with name data
  • Go inside data folder and create new folder db

Hope it would solve your error and let me know if not

mzparacha
  • 627
  • 6
  • 20
0

I had already data folder in c drive.It contains db and log folder.Even though I have faced the error .I could not run mongoDB in Localhost.I have faced the error What I have mentioned above.I tried...

step-1: I have uninstalled mongoDB version 4.0.2

step-2: I have deleted the data folder in cdrive and taken backup in some other location.

step-3: Again I have installed mongoDB version 4.0.2

step-4: I have copied the folder which I have taken backup previously in the same location c drive

Now problem is solved Everything working fine. Actually we have faced this problem because of system update.

Note: This is also one of the solution.For me its working fine. Thank you All...

demo developers
  • 161
  • 4
  • 18