MongoDB installation for Windows7 64-bit

Source: Internet
Author: User

Configuring the MONGO service side

Installing MongoDB

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

2. Create a new MongoDB folder on the D drive (this folder is the custom database installation directory D:\MongoDB) unzip the compressed package you just downloaded and copy the Bin folder to the MongoDB folder.

3. Create a new logs folder within the MongoDB folder (for storing log file D:\MongoDB\logs) and create a new empty file Mongodb.log within this folder.

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

5. Start MongoDB.
Run cmd as system Administrator and switch to D:\MongoDB\bin directory input Mongod.exe--dbpath=d:\mongodb\db. If you see the last line of the console similar to Tue Oct 11:50:55 [websvr] Admin Web console watiing for connections on port 28017 instructions to start successfully (MongoDB occupies system 28017 port)

6. Test MongoDB
Create a new CMD window as an administrator, enter the bin directory of MongoDB into MONGO, as shown in the connecting to:test instructions to pass the test.
To continue testing:
(1). Enter use Test return
(2). Input Db.foo.save ({hello:1, baie:2}) Enter
(3). Enter Db.foo.find () carriage return
If a similar {"_id" appears: ObjectId ("5073a0a090f93be1455461d2"), "Hello": 1, "Baie": 2}, the test success data has been inserted into the database, and then enter exit.

7. Register MongoDB as a system service (this step must run CMD as system administrator, otherwise an error will be made)
Run the cmd input as a system administrator and switch to the bin directory of MongoDB 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 similar to the Tue Oct 12:05:15 Service can be started in the command line with ' net start MongoDB ' statement, the service has been registered successfully.

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

9. If a system error occurs 1067 Please remove the Mongod.lock file from the DB directory and re-enter the net start MongoDB service.

--------------------------------------------------------------------------------------------------------------- -------------------------

First on the official website: http://www.mongodb.org/Download the latest MongoDB.

Create a new folder named MongoDB on your hard disk, my location is D:\mongodb. In this folder, create a new folder named Data and logs, which holds the database and logs separately.

Unzip the downloaded files and copy all the files in the Bin folder to the previously created folder in MongoDB. In cmd, enter the command separately:

D:

CD MongoDB

Mongod.exe--dbpath=d:/mongodb/data--logpath=d:/mongodb/logs/mongodb.log–install

Here MONGO the database is installed successfully, and join the Windows service item, in the Control Panel----Management tool----service to set MongoDB as a self-boot item, enter localhost:27017 in the browser to see the following content:

You is trying to access MongoDB on the native Driverport. For HTTP diagnostic access, add the port number

The installation of this MONGO database was successful.

Enter http://localhost:28017/in the browser to monitor the running status of MongoDB.

Mongod.exe--dbpath=d:/mongodb/data--logpath=e:\xampp\htdocs\platform2\protected\data\mongodb\logs\mongodb.log– Install

MongoDB installation for Windows7 64-bit

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.