Mangodb installation (Mac OS)

Source: Internet
Author: User

1. Download the corresponding version at http://www.mongodb.org/downloads

2. Create a folder structure such as/data/DB/in the root directory. By default, MongoDB stores data in this folder. Create a folder:

Sudo mkdir-P/data/DB

Modify folder permissions:

# Enter The sudo chmod 777 data directory of data # Enter The sudo chmod 777 dB directory of the database

3. decompress the downloaded file, put it in a specific directory, go to the MongoDB bin directory in the console, and enter:

./Mongod

If "dbexit: really exiting now" is displayed, the startup fails because the port is occupied or the/data/db operation permission is insufficient. If "waiting for connections on port 27017" is displayed, the instance is successfully started. You can enter http: // 127.0.0.1: 28017/in the browser to obtain the database management information.

4. Use shell to interact with MongoDB

Run on the console

./Mongo

Select database:

Use testdb

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.