Install the MongoDB Guide (Windows, Linux) using the command method _mongodb

Source: Internet
Author: User
Tags mongodb

First download the installation package to the MongoDB site http://www.mongodb.org/
Choose according to your operating system type and 32/64-bit.

Installing on Windows

Unzip the installation package and then create a directory for the data file, MongoDB the default C:\data\db as the data directory, or create other empty directories to save.

Set up the data directory, open the command prompt (Cmd.exe), into the MongoDB bin directory, execute Mongod.exe, if not the default directory to do the data directory, you need to use –dbpath to specify Mongod.exe–dbpath my directory

Sign up for MongoDB services

Use the full path to run, ignore all spaces, and use the –install option to install it.

Copy Code code as follows:

C:\mongodb\bin\mongod.exe–dbpath C:\data–install

install under Linux

In the same way, the data directory is created first, the default data directory is/data/db,

Create a directory and set write permissions as follows:

Copy Code code as follows:

$ mkdir-p/data/db
$ chown-r $USER: $USER/data/db

Into the MongoDB directory,
Copy Code code as follows:

$ bin/mongod

You can also use –dbpath to specify a different data directory
Copy Code code as follows:

$ bin/mongod-dbpath/data/db

For additional options about MongoDB, use Mongod–help to view

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.