Unable to start Mongo at my local machine

I am progressing through the courses and already had mongodb installed from the previous courses and trying to the first lab in m201.

Here is what I do:
I run the following command mongo in my cmd (which I started as an administrator) and get the following error:


Following the suggestions from similar port I changed the port, db path and logpath and got the following output with corresponding folder having been created:
and nothing really happens:

C:\WINDOWS\system32>mongod --port 27001 --dbpath “C:\data\db1” --logpath “C:\data\db1\log1.mongod.log”

Please let me know what I am doing wrong?

It looks like you do not know the difference between mongo and mongod.

You have to start the server with mongod and then connect with the client mongo.

No surprise I am confused with such explanations.

A little bit of elaboration??? exact commands would help.

The mongo shell

The mongod server

M201 is an intermediate course. There are prerequisites courses that go over these 2 concepts.

Not really, as they say, give a man a fish and you feed him for the day, teach him to fish and you feed him for the rest of his life. You will learn more by digging in the documentation by yourself.

Well, that explains a lot!

On a personal level, having spent some time on this forum and having read your some of your replies, I can tell, that you need to change your attitude towards people who are seeking answers. Not everybody is as experienced as yourself in this technology. You need to nurture and help rather than challenge people’s intelligence or mock with idioms. Having zero to non background (in my case) and even going through documentation is very confusing at times as some people might not have some basic concepts to be able to understand.
Other mentors (@Shubham_Ranjan, @Ramachandra_37567) unlike you on this forum provide some hints and clues which area to address instead of shoveling documentation by default (and they are very helpful) or provide rational why one way something will or will not work , even it might seem to be extremely basic and simple. With this being said, I do not deny that documentation can help, especially if one has some basics.
Remember, the main purpose of this training is not only to educate but also promote this technology and you are not doing much of a good commercial.

1 Like

I am sorry but I did provide a clue. It was

Understood your problem
Your mongod is up and running and your session appears to be hung but it is not
That is how it runs in Windows.Please check mongod.log.It should be saying waiting for connections
All you have to do is open another cmd prompt and connect using mongo
Also keep the first window where you ran mongod active
If you close or ctl+c your mongod gets killed

1 Like

Thank you so much! Straight to the point and very clear. Now I understand the reason.

I am connected but somewhat struggling importing the json files:
Get the syntax error

The command mongoimport has to be run outside the mongo shell. You have to exit your current mongo shell.

I did

Syntax error?

That is not how they use the command to import the restaurants data set. Please revise Chapter 1: Introduction - Lab 1.1: Install Course Tools and Datasets for the correct syntax. If you want to use arguments that are different from the one used in the lab refer to the documentation at:

Tried the following
mongoimport --drop -c restaurants --uri mongodb://localhost:27017/m201 restaurants.json

tried this following documentation
mongoimport -h localhost --drop --port 27017 -c restaurants --uri mongodb://localhost:27017/m201 --type json --file “C:\Program Files\MongoDB\Server\4.4\bin.restaurants.json”

Please explain what the problem is???

There is a typo in the path
After bin slash is missing

1 Like

Thank you @Ramachandra_37567 , sharp eye!
Appreciate your advice, always precise and straight to the point. Mongoimport works like a champ!