Lloydinator
Lloydinator

Reputation: 303

Can't run 'mongod' command, says not recognized

I'm trying to set up a local db server on my Windows 10 x64 machine. When I try to run anything with mongod it doesn't run. I've already added the PATH, which is now C:/mongodb/bin (tried just C:/mongodb already). Also when I try to run mongo.exe and mongod.exe from the bin folders, the command box launches and immediately disappears, even when run as administrator. What's going on?

Upvotes: 4

Views: 18618

Answers (4)

Ankit joshi
Ankit joshi

Reputation: 1

mongod.exe location in bin folders

open this file(mongod)manually .you would find some vcruntime140.dll and some others "dll file missing" error. Fix them using youtube videos. than you would be manually able to open this mongod file. than use command in terminal to load

/Users/hp/mongodb/bin/mongod.exe --dbpath=/Users/hp/mongodb-data.

now this command in terminal would work

Upvotes: 0

saber tabatabaee yazdi
saber tabatabaee yazdi

Reputation: 4959

after add mongo.exe path into env path in windows 10 i can run this command

but not applied

and after close terminal and vscode then restart all of them again

Upvotes: 0

Roman
Roman

Reputation: 21757

If you use Windows I would recommend

  1. to run cmd - Windows command prompt console
  2. to navigate to the folder, where you installed mongoDB, in particular, to the bin subfolder. In my case the path is

    C:\Program Files\MongoDB\Server\4.0\bin

  3. run mongo --version
  4. if your installation is correct than you will have something like

    MongoDB shell version v4.0.9<br />

    git version: fc525e2d9b0e4bceff5c2201457e564362909765

  5. to go to the the Windows Environment Variables (type Environment Variables in the WIndows search field)

  6. to add mongo (C:\Program Files\MongoDB\Server\4.0\bin) to Windows PATH Env
  7. to close cmd terminal and open again...

mongo --version should work from any place of your Windows

Upvotes: 7

ctorrez04
ctorrez04

Reputation: 101

What happens if you open a terminal and go to the mongo.exe path and run the exe from there? Doing that the command box won't disappear and you can see if there is any error.

Upvotes: 1

Related Questions