I. Introduction of MONGODB Database
Brief introduction
MongoDB is a high-performance, open-source, modeless, document-based database of distributed file storage, written in the C + + language, whose name is derived from the "Hu
MONGOUS ", is a kind of open source document database ──nosql database. NOSQL, the full name is not-only Sql, refers to the non-relational database.
Characteristics
MongoDB database is characterized by high performance, easy to deploy, easy to use and easy to store data. The main features are:
* For collection storage, easy to store object type data.
* Free mode.
* Support Dynamic Query.
* Full index support, including internal objects.
* Support Query.
* Supports replication and recovery.
* Use efficient binary data storage, including large objects (such as video, etc.).
* Automatically process fragmentation to support scalability at the cloud level
* Support multiple languages such as ruby,python,java,c++,php.
* File storage format is Bson (an extension of JSON)
* Available via Network access
Second, MongoDB database installation
MongoDB official: Http://www.mongodb.org/downloads
Under Windows MongoDB installation steps:
Installation Configuration
1, download MongoDB installation package, such as: Mongodb-win32-i386-1.8.1.zip;
2. Create a new directory "D:\MongoDB" to copy all the. exe files under the bin directory in the installation to the "D:\MongoDB" directory;
3. Create a new "data" folder in the "D:\MongoDB" directory to store the database.
start MongoDB service side
1. Execute the following statement in the CMD window:
>CD/D D:\MongoDB\bin\
>mongod--dbpath D:\MongoDB\data
2. Prompt interface for successful start
Microsoft Windows [version6.1.7600]
Copyright (c)2009Microsoft Corporation. All rights reserved.
C:\Users\libing>Cd/D D:\MongoDB\bin\
D:\MongoDB\bin>Mongod--DBPath D:\MongoDB\data
Mon June1310:41:11[Initandlisten] MongoDB Starting:pid=1484Port=27017DBPath=D:\MongoDB\data32-Bit
**Note:when using MongoDB32Bit, you is limited to about2Gigabytes of data
**See http://blog.mongodb.org/Post/137788967/32-Bit-Limitations
**With--Dur, the LimitIsLower
Mon June1310:41:11[Initandlisten] DB version v1.8.1, pdfile version4.5
Mon June1310:41:11[Initandlisten] git version:a429cd4f535b2499cc4130b06ff7c26f41c00f04
Mon June1310:41:11[Initandlisten] Build sys info:windows (5,1,2600,2,‘Service Pack 3‘) boost_lib_version=1_35
Mon June13 10:41:11< Span style= "COLOR: #000000" > [initandlisten] waiting for connections on port 27017
Mon jun 13 10:41:11 [websvr] web admin interface listening on port 28017 3. Browser opens MongoDB server
Open http://localhost:27017/in the browser and you can see the following:
You is trying to access MongoDB on the native driver port. For HTTP diagnostic access, add the port number
Further open the http://localhost:28017/in the browser to view the details.
MongoDB boot up service
1. Add Service
Run cmd as administrator, execute statement: D:\MongoDB\bin\mongod.exe--dbpath D:\MongoDB\data--directoryperdb--logpath D:\MongoDB\log\ MongoDB.log--logappend--servicename MongoDB--install
Description:--dbpath Set the database directory
--DIRECTORYPERDB create a separate directory for each database
--logpath Setting the log file directory
--logappend log file Append mode
--servicename Service Name
--install Installation
Additional parameter Settings >mongod--help
Microsoft Windows [version6.1.7600]
All rights reserved (c) 2009 microsoft corporation. All rights reserved.
C:\windows\system32>d:\mongodb\bin\ Mongod.exe--dbpath D:\MongoDB\data--directoryperdb--logpath D:\MongoDB\log\MongoDB.log--logappend--servicename MongoDB--installall output going to: d:\mongodb\log\ MongoDB.log
Creating service mongodb.
Service creation successful.
Service can be started from the command line via ' net start "MongoDB" ".
Note: net start "MongoDB"--Start MongoDB service
net stop "MongoDB"--Stop MongoDB service
C:\Windows\system32>net start "MongoDB"
Mongo DB Service is starting.The Mongo DB service has started successfully.
C:\Windows\system32>net stop "MongoDB"
Mongo DB service is stopping.
The Mongo DB service has stopped successfully.
2. Uninstall Service
Run cmd as administrator, execute statement: Mongod--remove--servicename "MongoDB"
Microsoft Windows [version6.1.7600]
Copyright (c)2009Microsoft Corporation. All rights reserved.
C:\Windows\system32>Mongod--Remove--ServiceName"Mongodb"
Deleting service MongoDB.
Service deleted successfully.
Mon June1311:03:11Dbexit:
Mon June1311:03:11Shutdown:going to close listening sockets ...
Mon June13 11:03:11Shutdown:going to flush Diaglog ...
Mon June1311:03:11Shutdown:going to close sockets ...
Mon June1311:03:11Shutdown:waitingForFS Preallocator ...
Mon June1311:03: 11 shutdown: closing all files ...
Mon jun 13 11:03 :11 closeallfiles ( ) finished
Mon jun 13 11:03 :11 dbexit: Really exiting now
Note: The Execute mongod command adds path D:\MongoDB\bin\ to the system environment variable path.
Third, MongoDB database visualization tool
1, Rockmongo
Http://code.google.com/p/rock-php/downloads/list
Introduction and installation of MongoDB database