FlyingFox
FlyingFox

Reputation: 141

How to resolve mongodump error "not recognized"?

Hi feel like this question has an easy answer but I just can't see it. I am using the command

Mongodump --db <name> 

and i get

'mongodump' is not recognized as an internal or external command,
operable program or batch file

. how can i get a backup of my mongodb thanks

Upvotes: 14

Views: 26345

Answers (3)

Jerry
Jerry

Reputation: 579

For windows10, please add the path in the environment variable section.

Firstly, download the mongodb data tools by https://www.mongodb.com/try/download/database-tools

  1. Right click the window start icon => click "system" => click "advanced system setting"
  2. Click "environment variable" Systme Properties
  3. Select "PATH", click "Edit" , click "New" => Add path which the mongodb data tools is installed Environment Varialbe

For your reference, my path is: C:\Program Files\MongoDB\Tools\100\bin Path

Finally, open the Windows PowerShell:

PS C:\>mongodump --version

The version of the mongodump should be shown which the setting is ok.

mongodump version: 100.5.3 
git version: 139703c0587796da96c367f365473d0266f9cede
Go version: go1.17.8
os: windows
arch: amd64
compiler: gc

ref link: https://www.mongodb.com/docs/database-tools/installation/installation-windows/

Upvotes: 10

bosskingswag
bosskingswag

Reputation: 231

Starting with MongoDB 4.4, the MongoDB Database Tools are now released separately from the MongoDB Server and use their own versioning, with an initial version of 100.0.0. Previously, these tools were released alongside the MongoDB Server and used matching versioning.

https://www.mongodb.com/try/download/database-tools?tck=docs_databasetools

Once database tools contents are put into the bin, set the path and restart your PC.

Upvotes: 23

Mohammad Faisal
Mohammad Faisal

Reputation: 2402

You need to run set path command first, if you have installed mongodb.

set path="<mongodb installed directory which contain mongodump file>"

enter image description here

If you don't want to set path every time you open command prompt. then, set the path in environment variables if you are using windows.

Upvotes: 5

Related Questions