Mongodb installation and configuration tutorial, doscommand, mongodbdos

Source: Internet
Author: User
Tags mongodb server

Mongodb installation and configuration tutorial, doscommand, mongodbdos

Download: you can download it from the official website.

The default installation directory is (C: \ mongodb \)

Create a data directory

Create a data DIRECTORY And a log directory under the root directory. The data directory should be placed under the root directory (for example, C: \ data \ db and C: \ data \ log ).

Configure the MongoDB Service

Create a configuration file in C: \ mongodb \ mongod. cfg

SystemLog:

Destination: file

Path: c: \ data \ log \ mongod. log

Storage:

DbPath: c: \ data \ db

Install the MongoDB Service

Doscommand: "C: \ mongodb \ bin \ mongod.exe"-config "C: \ mongodb \ mongod. cfg"-install

Use mongodb

Doscommand:

Step 1: Enable MongoDB server C: \ mongodb \ bin \ mongod.exe or C: \ mongodb \ bin \ mongod-dbpath c: \ data \ db

Step 2: connect to mongodb C: \ mongodb \ bin \ cmd.exe

Step 3: db. runoob. insert ({x: 10 })

Step 4: db. runoob. find ()

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.