Installing and configuring MongoDB under Mac

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.