MongoDB Installation Guide

Source: Internet
Author: User

MongoDB Installation

1. Unzip the Mongodb-win32-i386-1.8.1.zip, create the path C:\Program Files\mongodb, and copy the extracted bin file to this folder

2.c:\program Files\mongodb set up the Data folder C:\Program Files\mongodb\data, and then set up a Db,log two folders, at this point MongoDB has the following folder

C:\Program Files\mongodb\bin

C:\Program files\mongodb\data\db

C:\Program Files\mongodb\data\log

Create a log file under the log folder MongoDB.log, which is C:\Program Files\mongodb\data\log\mongodb.log

After completing the above work, you are wondering why to create these folders (because the MongoDB installation requires these folders, the default installation is not created, but the files are installed to C:\data\)

3. Installation Type

3.1 Program Start mode

Run Cmd.exe into DOS hit interface

> CD C:\Program files\mongodb\bin

> C:\Program files\mongodb\bin>mongod-dbpath "C:\Program files\mongodb\data\db"

Execute this command to create a database file of MongoDB to the C:\Program files\mongodb\data\db directory, and not unexpectedly see a successful prompt sucess the last line of the command

At this point the database has been started, the interface is MONGO startup program, closed after you can directly double-click on the bin Mongod.exe (Note is D, this is the startup program)

After the startup program is turned on, run the Mongo.exe program (note that there is no d), the interface is as follows

Test database Operations

>help (View related information)

>db.foo.insert ({a:1}) (Insert a,1 field value to Foo table, Foo table as default table)

>db.foo.find () (View foo table data)

3.2 Windows Service mode

Run Cmd.exe

> CD C:\Program files\mongodb\bin

> C:\Program files\mongodb\bin>mongod--dbpath "C:\Program files\mongodb\data\db"--logpath "C:\Program files\ Mongodb\data\log\mongodb.log "--install--servicename" MongoDB "

Here MongoDB.log is the log file that was started,--servicename the "MongoDB" service named MongoDB

Run the command successfully for such as:

The time service has been installed successfully, running

>net Start MongoDB (open service)

>net Stop MongoDB (shutdown service)

Tools:

MongoVUE.exe

Robomongo

MongoDB Installation Guide

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.