Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 406
Lloydinator Avatar asked Feb 05 '23 12:02

Lloydinator


1 Answers

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

like image 92
Roman Avatar answered Feb 08 '23 14:02

Roman