MongoDB installation, startup, registration for Windows system Services

Source: Internet
Author: User

MongoDB Installation and startup

Zhou Jianxu 2014-08-10

Configure environment variables after decompression

Download the Windows 32-bit or 64-bit version and unzip, the program files are in the bin directory, the other two directories are C + + calls the header file and the library file.

The Bin directory contains the following programs:

1. Mongo.exe, command-line client tools.

2. Mongod.exe, database service program.

3. Mongodump.exe, database backup program.

4. Mongoexport.exe, Data Export tool.

5. Mongofiles.exe,gridfs tools.

6. Mongoimport.exe, data import tool.

7. Mongorestore.exe, Database recovery tool.

8. Mongos.exe, seemingly a performance testing tool.

Cmd Enter MONGO to see if the success

I'm going to start MongoDB in three different ways.

Mode one : CMD Command Console input mongod--dbpath d:\mongodata

D:\mongodata is the path to the database , which can be created automatically without any folders.

Method Two : Batch File

See a . bat file to paste mongod--dbpath d:\mongodata into the inside , you can use this . Bat The file starts.

Mode three : registering as a Windows system service

D:\soft\mongodb\mongodb-win32-x86_64-2.4.0\bin\mongod.exe--logpath D:\soft\mongodb\mongodb-win32-x86_64-2.4.0\ Mongolog\mongodb.log--logappend--dbpath D:\soft\mongodb\mongodb-win32-x86_64-2.4.0\mongodata--directoryperdb-- ServiceName MongoDB--install

Incmdcommand in the text above or a set of commands above,Note that mongolog and mongodata should be created first. mongodb.log files are log files,MongoDB is created automatically.

randomly start MongoDB as a Windows Service

(If prompted:Error connecting to the Service Control ManagerThis error, you should run with administratorcmdFind the command handlerc:\windows\system32\cmd.exe  right: Run as Administrator  )

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.