MongoDB Installation
1. Unzip the Mongodb-win32-i386-1.8.1.zip, create the path C:\Program Files\mongodb, and copy the extracted bin file to this folder
2.c:\program Files\mongodb set up the Data folder C:\Program Files\mongodb\data, and then set up a Db,log two folders, at this point MongoDB has the following folder
C:\Program Files\mongodb\bin
C:\Program files\mongodb\data\db
C:\Program Files\mongodb\data\log
Create a log file under the log folder MongoDB.log, which is C:\Program Files\mongodb\data\log\mongodb.log
After completing the above work, you are wondering why to create these folders (because the MongoDB installation requires these folders, the default installation is not created, but the files are installed to C:\data\)
3. Installation Type
3.1 Program Start mode
Run Cmd.exe into DOS hit interface
> CD C:\Program files\mongodb\bin
> C:\Program files\mongodb\bin>mongod-dbpath "C:\Program files\mongodb\data\db"
Execute this command to create a database file of MongoDB to the C:\Program files\mongodb\data\db directory, and not unexpectedly see a successful prompt sucess the last line of the command
At this point the database has been started, the interface is MONGO startup program, closed after you can directly double-click on the bin Mongod.exe (Note is D, this is the startup program)
After the startup program is turned on, run the Mongo.exe program (note that there is no d), the interface is as follows
Test database Operations
>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)
3.2 Windows Service mode
Run Cmd.exe
> CD C:\Program files\mongodb\bin
> C:\Program files\mongodb\bin>mongod--dbpath "C:\Program files\mongodb\data\db"--logpath "C:\Program files\ Mongodb\data\log\mongodb.log "--install--servicename" MongoDB "
Here MongoDB.log is the log file that was started,--servicename the "MongoDB" service named MongoDB
Run the command successfully for such as:
The time service has been installed successfully, running
>net Start MongoDB (open service)
>net Stop MongoDB (shutdown service)
Tools:
MongoVUE.exe
Robomongo
MongoDB Installation Guide