Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using mongodump: "mongodump: command not found"

Tags:

macos

mongodb

I'm trying to get a dump of my local database and it seems I should be using:

mongodump --host localhost:3002 

However, the terminal then tells me:

-bash: mongodump: command not found 

Am I missing something? Or going about this the wrong way? I'm using it on Mac from the terminal.

I installed mongo (I think) using the following commands:

curl http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.4.5.tgz > mongodb.tgz  tar -zxvf mongodb.tgz 
like image 793
ediblecode Avatar asked Aug 08 '13 10:08

ediblecode


2 Answers

As of MongoDB 4.4 (released July 30, 2020), you may need to install mongodump separately because the MongoDB Database Tools (which comprises mongodump, mongorestore, and more) has become its own project.

I found this out because I upgraded to MongoDB 4.4 today and mongodump stopped working.

$ mongodump zsh: command not found: mongodump 

I'm on macOS and installed MongoDB via Homebrew. To get mongodump and friends back, I installed the MongoDB Database Tools via Homebrew:

brew tap mongodb/brew brew install mongodb-database-tools 

If you're on a different OS, this should help:

MongoDB Database Tools Installation

like image 24
ptrkcsk Avatar answered Sep 19 '22 06:09

ptrkcsk


brew tap mongodb/brew; brew install mongodb-community will also install mongodump.

If you don't have the brew command, you really should consider install Homebrew

like image 107
vinyll Avatar answered Sep 22 '22 06:09

vinyll