For example install MondoDB 2.6.12 on macOS Catalina
-
Download, extract and move:
wget http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.12.tgztar xzf mongodb-osx-x86_64-2.6.12.tgzmv mongodb-osx-x86_64-2.6.12/ /usr/local/mongodb/ -
Add to file
~/.zshrcthis:export PATH="$PATH:/usr/local/mongodb/bin"PS:
.bash_profileor.profilenot worked in my case -
Mkdir directory for data and set rights:
mkdir -p ~/data/dbchown -R mongodb.mongodb ~/data/db -
Run MongoDB:
mongodb --dbpath ~/data/db