MongoDB Install for Windows7 X64

Source: Internet
Author: User
Tags install mongodb

Original http://blog.sina.com.cn/s/blog_685213e70101g81t.html

Install MongoDB (initial)

1. Download Http://www.mongodb.org/downloads According to the operating system.

2. In D disk, create a new MongoDB folder (this folder is a custom database installation directory D:\MongoDB) unzip the compressed package just downloaded and copy the Bin folder to the MongoDB folder.

3. Create a new logs folder within the MongoDB folder (used to store the log file D:\MongoDB\logs) and create a new empty file in this folder Mongodb.log.

4. Create a new DB folder within the MongoDB folder (for storing the database file D:\MongoDB\db).

5. Start MongoDB.
Run cmd as the system administrator and switch to D:\MongoDB\bin directory input Mongod.exe--dbpath=d:\mongodb\db. If you see the console last [Initandlisten] waiting for connections on port 27017 Tue Oct 11:50:55 [websvr] Admin Web console watiing F or connections on port 28017 indicates successful startup (database port and Web port, 27017 and 28017, respectively), open http://localhost:28017 in the browser, and see some of its related information. )

6. Test MongoDB
Create a new CMD window as an administrator and enter the MongoDB bin directory input MONGO, such as the connecting To:test description test pass.
To continue the test:
(1). Enter use Test return
(2). Enter Db.foo.save ({hello:1, baie:2}) carriage return
(3). Enter Db.foo.find () carriage return
If you receive information such as {"_id": ObjectId ("5073a0a090f93be1455461d2"), "Hello": 1, "Baie": 2}, the test success data has been inserted into the database, and then enter exit exit.

7. Register MongoDB for System services (this step must be run as a system administrator cmd, or it will be an error)
Run cmd input as a system administrator and switch to MongoDB's Bin directory to run the following statement
Mongod.exe--dbpath=d:\mongodb\db--logpath=d:\mongodb\logs\mongodb.log--install--servicename "MongoDB"
Enter
If the console appears with a statement similar to the Tue Oct 12:05:15 Service can is started from the command lines with ' net start MongoDB ', the service has been registered successfully. (Uninstall service Mongod.exe--remove--servicename "MongoDB")

8. Enter the net start MongoDB in cmd to start the MongoDB database service, at which point the console output MONGO DB service has started successfully, indicating that the system started successfully.

9. If a system error occurs  1067  Please delete the Mongod.lock file in the DB directory and re-enter the Net start mongodb start service.

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.