MongoDB installation and start-up
Download Link: http://www.mongodb.org/downloads
First step: Download the installation package
Step Two: Create a new directory "D:\Mongodb" under D, unzip the downloaded installation package and copy the bin directory to D:\Mongodb
Step three: Create a new "data" folder in the "D:\Mongodb" directory, which will be the root directory for data storage.
Configuring the service sideFirst step: Open command Line window (Start---> Run--->cmd) Step two: Enter the command DOS code in the following format
C:\Documents and settings\chenzhou>d:d:\>cd d:\mongodb\bind:\mongodb\bin>mongod-- DBPath D:\Mongodb\data
The following interface is displayed when the configuration is successful:
Mon Dec A +: +: theMon Dec A +: +: theWarning +-bit servers Don'T has journaling enabled by default. --journal If you wanturability. Mon Dec A +: +: theMon Dec A +: +: the[Initandlisten] MongoDB starting:pid=4220port=27017Dbpath=d:\mongodb\data +-bit host=Cy3379mon Dec A +: +: the[Initandlisten]mon Dec A +: +: the[Initandlisten] * * Note:when using MongoDB +Bit, you is limited to about2gigabytes of Datamon Dec A +: +: the[Initandlisten] * * See http://blog.mongodb.org/post/137788967/32-bit-limitationsMon Dec A +: +: the[Initandlisten] * * with--Journal, the limit is Lowermon Dec A +: +: the[Initandlisten]mon Dec A +: +: the[Initandlisten] DB version v2.0.2-RC2, pdfile version4.5Mon Dec A +: +: the[Initandlisten] git version:7d32bec61fd25e2d1e728e24d0d127a8a73e38e0mon Dec A +: +: the[Initandlisten] BuildInfo: Windows (5,1,2600,2,'Service Pack 3') boost_lib_version=1_42mon Dec A +: +: the[Initandlisten] Options: {dbpath:"D:\Mongodb\data"}mon Dec A +: +: the[Initandlisten] Waiting forConnections on port27017Mon Dec A +: +: the[WEBSVR] Admin Web Console waiting forConnections on port28017Mon Dec A +: -: the[Clientcursormon] Mem (MB) Res: -Virt +Mapped0
Note: We did not specify the port number of the service when we configured the MongoDB service, so we will specify the default port number of MongoDB 27017 we can also specify ports at configuration time. Example: If we want to specify MongoDB with a service port number of 10001, the command is as follows:
10001
Access
Browser AccessIn the browser input: 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 been fully started.
Client Connection DatabaseOpen another CMD window, the original window does not close, if the window closes then the service also closes first through the CD command to switch to the Mongodb\bin directory, and then through the MONGO ip:port command to connect the database IP on behalf of the database service we need to access the IP, Port on behalf of the database service
C:\Documents and settings\chenzhou>d:d:\>cd mongodb\bind:\mongodb\bin127.0. 0.1:270172.0. 2-127.0. 0.1:27017/Test>
On behalf of the successful access, connect to the test library as in the example above 127.0.0.1 for native, 27017 is MongoDB server default port if we are using the default port when we configure MongoDB service, we can use the client access without specifying the IP and port
C:\Documents and settings\chenzhou>d:d:\>cd mongodb\bind:\mongodb\bin>2.0 . 2-rc2connecting to:test>
Similarly, access is successful and connected to the test library
MongoDB installation and startup under Windows