[Go] Install run MongoDB under WIN7

Source: Internet
Author: User
Tags mongodb server win32

This article transferred from: http://www.cnblogs.com/snake-hand/p/3172376.html

1) , download MongoDB Http://downloads.mongodb.org/win32/mongodb-win32-i386-2.4.5.zip

Download the Windows 32-bit version and unzip, the program files are in the bin directory, the other two directories are C + + calls are header files and library files. 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 tool.
6. Mongoimport.exe, data Import tool.
7. Mongorestore.exe, Database Recovery tool.
8. Mongos.exe, seemingly a performance testing tool.

2), set up MongoDB directory

Unzip it to D:\, and then rename it to MongoDB, the path is D:\mongodb

3), set the data file path

In D: Set up a Data folder, create a new DB folder in the Data folder, the path d:\data\db

4), start MongoDB service

Go to CMD prompt console, D:\mongodb\bin\mongod.exe--dbpath=d:\data\db

Mon APR 16 08:50:54
Mon APR 08:50:54 warning:32-bit servers don ' t has journaling enabled by Def
Ault. Please use the--journal if you want durability.
Mon APR 16 08:50:54
Mon APR 08:50:54 [Initandlisten] MongoDB starting: pid=5084port=27017 dbpat  
h=d:\data\db 32-bit host=pc-201012302214 
Mon APR 08:50:54 [Initandlisten]
Mon APR 08:50:54 [initandlisten] * * Note:when using MongoDB + bit, you is
Limited to about 2 gigabytes of data
Mon APR 08:50:54 [Initandlisten] * * See       HTTP://BLOG.MONGODB.ORG/POST/13
7788967/32-bit-limitations
Mon APR 08:50:54 [initandlisten] * *       with--journal, the limit is lower
Mon APR 08:50:54 [Initandlisten]
Mon APR 08:50:54 [initandlisten] db version v2.0.4, pdfile version 4.5
Mon APR 08:50:54 [Initandlisten] git version:329f3c47fe8136c03392c8f0e548506
Cb21f8ebf
Mon APR 08:50:54 [Initandlisten] Build info:windows sys.getwindowsversion (ma
Jor=6, minor=0, build=6002, platform=2, service_pack= ' Service Pack 2 ') boost_lib
_version=1_42
Mon APR 08:50:54 [Initandlisten] Options: {dbpath: "D:\data\db"}
Mon APR 08:50:54 [websvr] Admin Web console waiting for connections on port 2
8017
Mon APR 08:50:54 [Initandlisten] waiting for connections on port 27017

default connection port for MongoDB server: 27017

5), randomly start MongoDB as a Windows service

Create a D:\mongodb\logs\mongodb.log file to store the MongoDB log files before installing system services: D:\mongodb\bin\mongod --dbpath=d:\data\db --logpath=d: \mongodb\logs\mongodb.log--install

(If prompted: Error connecting to the Service Control Manager, you should run CMD with administrator

Locate the command handler C:\Windows\System32\cmd.exe right-click: Run as Administrator

All output going to:d:\mongodb\logs\mongodb.log   Creating service MongoDB.   Service creation successful.   Service can is started from the command line via ' net start ' MongoDB '.  D:\>net start MongoDB   Service has started successfully.    
Note: If you need to uninstall the service, execute the command:SC delete MongoDB

6), Client connection verification

Open a new cmd input: D:\mongodb\bin\mongo, if prompted below, then you can start the MongoDB tour:

D:\mongodb\bin\mongo  
MongoDB Shell version:2.0.4  
Connecting To:test  

7), view MongoDB log

View the D:\mongodb\logs\mongodb.log file to view or debug the operation of MongoDB.

Http://localhost:27017/can see the following prompt: You is trying to access MongoDB on the native driver port. For HTTP diagnostic access, add the port number so that the MongoDB database service has successfully started.

http://localhost:28017/Management

[Go] Install run MongoDB under WIN7

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.