Using mongodump: "mongodump: command not found"
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.
$ mongodumpzsh: 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/brewbrew install mongodb-database-tools
If you're on a different OS, this should help:
If you just extracted the .tgz file, the mongodump command is not available in your PATH. Go to your /bin/ subdirectory inside the directory where you have extracted mongodb.tgz, the mongodump binary should be there. Now you can execute:
./mongodump --host localhost:3002
It's much better though to install MongoDB with a package manager. Read this page:http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/and use, for example, Homebrew to install MongoDB and have all the necessary binaries in PATH.