Mongod command not found (Windows7)(node.js)

27,255

Solution 1

Add the mongo's path to the PATH environment variable.

Reference: https://youtu.be/sBdaRlgb4N8?t=120

Solution 2

You need to use ./ to run mongod.exe file. use ./mongod.exe It'll run successfully.

Solution 3

When you open the bin folder it has a file called mongod.pdb instead of mongod.exe But don't worry. It could be rectified by adding the path to the environment variables. By appending the path of the bin folder (C:\Program Files\MongoDB\Server\3.4\bin) you are allowing the computer to run the executable files in that particular folder.

Solution 4

Set the path variable. When you open the bin folder it has a file called mongod.pdb instead of mongod.exe But don't worry. It could be rectified by adding the path to the environment variables. By appending the path of the bin folder (C:\Program Files\MongoDB\Server\3.4\bin) you are allowing the computer to run the executable files in that particular folder.

shutting down with code:100

When you run mongod.exe if the DB is shutting down with code:100, then you need to make two folders (data and db) to create databases. Use mkdir C:\data\db

Share:
27,255
Tristan Marr
Author by

Tristan Marr

Updated on June 02, 2020

Comments

  • Tristan Marr
    Tristan Marr about 4 years

    I have been trying to get my mongodb going for about a day now. The problem seems to be that the mongod command is not found. I have the npm package mongoose installed in my node.js build. When i try to start the server with the mongod command the git bash returns that the command is not found.

    I have been googleing for an answer and it looks like i need to make mongodb into a command, i'm not sure how to do this. Any advice would help.

    I have downloaded the mongodb into my files it's located here C:\Program Files\MongoDB\Server\3.0 ( Not sure if that matters or not).

    Really not sure what to do from here.

  • Tristan Marr
    Tristan Marr about 9 years
    Thanks! I was looking for a video just like this.
  • Soren
    Soren over 6 years
    Is does this not happen automatically? That would be quite useful.
  • logos_164
    logos_164 about 6 years
    Is this specific to Windows? i.e. if we were running this on Ubuntu would there be a similar process that you know of? Just out of curiousity because I run a lot of development on Ubuntu using Virtual Box
  • Justin L.
    Justin L. almost 6 years
    I just downloaded mongo 4.0.2 and neither mongo nor mongod are in the bin folder at C:\Program Files\MongoDB\Server\4.0\bin -- any ideas why that might be and how i can fix it?