Download MongoDB Install to: E:\Work_App\MongoDB this directory
Installation: E:\Work_App\MongoDB (installed in a dedicated directory)
Configuration:
1. Create a new Data folder under E:\Work_App\MongoDB\
2. Create a new db and log folder under E:\Work_App\MongoDB\Data
3. Create a new MongoDB.log file under E:\Work_App\MongoDB\data\log
Start MongoDB:
Enter the E:\Work_App\MongoDB\bin,
Input: Mongod-dbpath "E:\Work_App\MongoDB\Data\db"
Role: Create a MongoDB database file into the E:\WORK_APP\MONGODB\DATA\DB directory
Attention:
1, attention is Mongod.exe
2. This interface will stop at 2015-03-26t15:19:17.135+0800 I NETWORK [Initandlisten] waiting for connections on port 27017 (the database is now started)
First knowledge of MongoDB:
New Open [ Note is new ] after a cmd window, then run the Mongo.exe program (note that there is no d), at this time the previous window is displayed: 2015-03-26t15:31:10.148+0800 I NETWORK [ Initandlisten] Connection accepted from 127.0.0.1:60408 #1 (1 connection now OPEN)
Now it's time to use the MongoDB database.
>help (View related information)
>db.foo.insert ({a:1}) (Insert a,1 field value to Foo table, Foo table as default table)
>db.foo.find () (View foo table data)
Start MongoDB as a Windows service
Sign up for MongoDB Service
Entry: E:\Work_App\MongoDB\bin
Input: Mongod-dbpath "E:\Work_App\MongoDB\Data\db"-logpath "E:\Work_App\MongoDB\Data\log\MongoDB.log"-install- ServiceName "MongoDB" (this must be run as Administrator)
At this point the service is installed successfully, running
>net Start MongoDB (open service)
>net Stop MongoDB (shutdown service)
- 2
Delete MongoDB Service
Mongod-dbpath "E:\Work_App\MongoDB\Data\db"-logpath "E:\Work_App\MongoDB\Data\log\MongoDB.log"-remove- ServiceName "MongoDB"
--Registration with permission authentication Mode service
Mongod-dbpath "D:\Program files\mongodb\db"-logpath "D:\Program files\mongodb\log\mongodb.log"-auth-install- ServiceName "MongoDB"
At this point the service is installed successfully, running
>net Start MongoDB (open service)
>net Stop MongoDB (shutdown service)
MongoDB Registered Windows service startup