In this post we will see How to install MongoDB on Mac OS X. MongoDB is one of the most used, open-source document database, and NoSQL database. MongoDB is developed by 10gen.
MongoDB: Install on MacOS In this tutorial, we present a step by step tutorial on how to install MongoDB on Mac OS. The operating system considered for this tutorial is macOS 10.14 (Mojave). Mongoclient is a cross-platform solution for connecting to and managing MongoDB databases: the app enables you to configure multiple connections, provides support for using URLs, and can also work.
STEP 1 – Downloading MongoDB .tgz
file
Visit MongoDB official website and download the .tgz file from the community section of the website.
Now extract the downloded .tgz
and mv the mongo directory to /usr/local/mongod
b directory using following command in terminal.
2 | $tar-zxvf mongodb-osx-ssl-x86_64-3.6.1.tgz $sudo mvmongodb-osx-ssl-x86_64-3.6.1/usr/local/mongodb |
STEP 2 – Create MongoDB Data directory (/data/db
)
MongoDB stores the data into the /data/db directory by default, so we need to create this directory and also assign proper permission using chown command.
Open the terminal run the following command