MongoDB Learning Notes (i)-MONGODB configuration _mongodb

Source: Internet
Author: User
Tags create mongodb mongodb

MongoDB Introduction

MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for WEB applications.

MongoDB is a product between relational database and non relational database, and is the most powerful and relational database in the relational database.

Step into the business:

Download MongoDB

Download Address: Https://www.mongodb.com/download-center?jmp=nav

Here is the installation of MongoDB under the Windows platform,

After downloading, on this machine, follow the prompts to install.

Note: This installation is only to get MongoDB files, the installed machine is not a server.

For example, this machine is installed in D:\MongoDB\Server\3.2

Configuring the server

1. Create a table of contents

Create a directory C:\MongoDB on the server (Windows Server 2008), as shown in the following figure:

Contains four directories

BIN MongoDB's Program Files
Config Configuration file
Data Data file directory
Log Log files

2. Copy files

Copy the first step to the server C:\MongoDB\BIN directory for all files in the D:\MongoDB\Server\3.2\BIN directory installed on this machine.

In addition, locate the Msvcp120.dll and Msvcr120.dll files on this computer and copy them to the server's Bin directory.

3. configuration file

In the config directory, create the Mongod.cfg file. The contents are as follows:

Dbpath=c:\mongodb\data

Logpath=c:\mongodb\log\mongo.log

Logappend=true

Directoryperdb=true

#auth =true

Start the MongoDB service

In the server's C:\MongoDB\Bin directory, run CMD as an administrator and execute the following command

SC create MongoDB binpath= "C:\MongoDB\bin\mongod.exe--config=c:\mongodb\config\mongod.cfg--service"

Then start the service net start MongoDB

Test

In the C:\MongoDB\Bin directory to run CMD, and execute the following command

Copy Code code as follows:

C:\mongodb\bin>mongo
Show DBS//Display Database
Use MyDB//create and switch databases
Db. Projects.insert ({"Name": "Project"})///In the Projects collection, insert a record
Help//Assistance

Connection test

On the client, run Mongovue and connect to the server.

Test Connection Successful!

Uninstall the MongoDB service

On the server side, run cmd as an administrator and execute the following instructions:

Copy Code code as follows:

C:\MongoDB\bin mongod.exe--remove--servicename "MongoDB"

The above is a small set to introduce the MONGODB study notes (a)-mongodb configuration, hope for everyone to help, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.