MongoDB installation and startup simple to use

Source: Internet
Author: User
Tags brew install mongodb install mongodb

Environment: Mac 10.11.6

First, installation steps: According to the official website of the tutorial:

1. Open terminal installation or upgrade brew:

Brew Update

2. Installing MongoDB binary files:

Brew Install MongoDB

If you need Tls/lls support:

Brew Install MongoDB--with-openssl

If you need the latest development version, use it for early adopters:

Brew Install MongoDB--devel

Wait for a moment and then you can.

Second, if you do not want to go through the command line, you can manually install:

1, to: Https://www.mongodb.org/downloads Download the appropriate version of the compression package. can also be in the terminal:

Curl-o https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.7.tgz

2. After successful download: Unpack the package with unzip command

TAR-ZXVF mongodb-osx-x86_64-3.2.7.tgz

3. Copy the extracted files to your own new directory:

For example: root directory under/mongodb

Mkdir-p MongoDB
Cp-r-N Mongodb-osx-x86_64-3.2.7/mongodb

4, switch to the directory to: CD ~/.BASHRC, open this file, some OS system may be: in ~/.bash_profile edit the following command line to add to the end of the file:

Export Path=/mongodb/bin: $PATH, execute source ~/.BASHRC to make configuration path valid

In most cases, the command line is recommended for quick and easy installation.

Third, the operation:

1, after the successful installation. In terminal execution:

Mkdir-p/data/db

Create a database path.

2. Input command line: Mongod

Start MongoDB and you'll see

Prove that the MongoDB service is ready.

Next, you can connect to the database.

In the browser, type: localhost:27017

See a line of hints:

It looks like you is trying to access MongoDB over HTTP on the native driver port.

Is the driver port that prompts you to connect to the database over HTTP

3. You can then switch to a new directory to open a new terminal and enter: MONGO 127.0.0.1:27017

See

Enter the MongoDB shell environment, where you can do some simple database operations.

Use student, the scripting environment will prompt you to switch to the student database.

As for how to clear the warning?? : reference

A warning appears after MONGODB installation: * * Warning:soft rlimits too low. Number of files is a, should be at least

  

MongoDB installation and startup simple to use

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.