Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (50.2k points)

I am new to mongo. I am getting this error while typing the following command:

mongo

MongoDB shell version: 2.2.1

connecting to: test

Fri Nov  9 16:44:06 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91

exception: connect failed

In the logs section, I can see the following set of code:

now open)

Fri Nov  9 16:44:34 [conn47] end connection 10.29.16.208:5306 (1 connection now open)

Fri Nov  9 16:45:04 [initandlisten] connection accepted from 10.29.16.208:5307 #48 (2 connections now open)

Fri Nov  9 16:45:04 [conn48] end connection 10.29.16.208:5307 (1 connection now open)

Fri Nov  9 16:45:04 [initandlisten] connection accepted from 10.29.16.208:5308 #49 (2 connections now open)

Fri Nov  9 16:45:04 [conn49] end connection 10.29.16.208:5308 (1 connection now open)

Fri Nov  9 16:45:34 [initandlisten] connection accepted from 10.29.16.208:5316 #50 (2 connections now open)

Fri Nov  9 16:45:34 [conn50] end connection 10.29.16.208:5316 (1 connection now open)

Fri Nov  9 16:45:34 [initandlisten] connection accepted from 10.29.16.208:5317 #51 (2 connections now open)

Fri Nov  9 16:45:34 [conn51] end connection 10.29.16.208:5317 (1 connection now open)

Fri Nov  9 16:46:04 [initandlisten] connection accepted from 10.29.16.208:5320 #52 (2 connections now open)

Fri Nov  9 16:46:04 [conn52] end connection 10.29.16.208:5320 (1 connection now open)

Fri Nov  9 16:46:04 [initandlisten] connection accepted from 10.29.16.208:5321 #53 (2 connections now open)

Fri Nov  9 16:46:04 [conn53] end connection 10.29.16.208:5321 (1 conn

I am new to MongoDB and could not able to understand what exactly is happening? Can you guide me?

1 Answer

0 votes
by (108k points)

This error is happening because you have not connected your MongoDB server. You have to open your MongoDB server:

mongod -dbpath “C:\Program Files\MongoDB\Server\4.2\data” 

Then you can perform your operations.  If you want to learn more about MongoDB then go through this MongoDB course for more insights.

Browse Categories

...