How to resolve mongodump error "not recognized"?
Asked Answered
W

3

13

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

Whitaker answered 31/8, 2020 at 13:53 Comment(1)
Hi I used "set path" but when I run the mongodump command it gives me the same errorWhitaker
C
22

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.

Caboose answered 21/4, 2021 at 14:25 Comment(0)
E
10

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/

Elector answered 7/7, 2022 at 1:58 Comment(1)
I did all this and still getting the errorAllocution
S
5

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.

Silsby answered 31/8, 2020 at 15:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.