The following is the way to download the installation package decompression installation:
Https://www.mongodb.com/download-center#community, can also self-Baidu
First, unzip the downloaded installation package to the path where you want to install Mangodb
This machine decompression under documents, you can change the file name to a simple and easy to read MongoDB (their own habit, here this machine with the MongoDB filename decompression)
Second, configure environment variables
Enter the bin file directory in MongoDB, for example, the local path is:/users/tiany/documents/mongodb/bin, then enter the command line echo ‘export PATH=/Users/
user name, restart the /Documents/mongodb/bin:$PATH‘>>~/.bash_profile
shell Terminal, or enter the command source .bash_profile
To see if the environment variable was added successfully:
echo $PATH
Create the data/db directory in the root directory/under (that is, your user directory) to place the MongoDB data and set permissions on the directory
The Permission Settings command is: sudo mkdir -p /data/db
sudo chown-r user name (example native to Tiany)/data
Note: Re-enter the sudo chown-r username (example native to Tiany)/data when the user name requires a space
Iv. Start MongoDB Service
Open the terminal, enter the bin path under MongoDB, and then enter./mongod, if a large piece of content is displayed without an error, it has been successfully started.
Open another terminal, enter the bin path under MongoDB, enter the./mongo, if the Welcome to the MongoDB Shell is displayed, it means that the connection is working properly.
Installing and configuring MongoDB under Mac