Note: The latest version of the official website of the mango is no longer support XP system, and does not support 32-bit Windows systems, the latest version supports only Windows Server R2, Windows 7, and the latest Windows system, and support for SSL (ensure that the data on the Internet transport security) security protocol
First, mango DB official website Download: Windows channel
Note: not recommended to use the latest 3.6.x version of the official website of mango DB! ! !
After entering the Select --------->
Download msi (about five minutes fast speed, medium speed for about ten minutes)
Second, the installation msi file (msi -> Windows Installer packets)
Note: To avoid this step in the installation may be into the pit, please be careful, I feel ok want to try it, then install the latest version of the official website, if you feel a little bad, then, please continue to read, select the 3.4 version the DB installation
Next (Remember accept check box) ----> Next (Custom select custom installation) ----> Next (if large, then the C drive, installed in the C drive)
Continue Next ---> Next (two consecutive), the last ----> Install
Mmp saying I do not know when to speak improper talk, you told me installation requires only few minutes, Arcane, you shameless necessarily give me the card for nearly half an hour, and motionless!
I have no patience, rumored to install 3.6.x version of mango DB under Windows is indeed very slow, waited two hours to install the (character?), And so there is an afternoon or jammed ( depressed), but also a man of God had to wait a day, is still stuck (tragedy) ,, what happened during installation, only official website to explain why so favoring Linux system? Our poor Windows users ah, but that's okay, we download and install the 3.4 version, it is said this is no problem
Download (Full version history here): win32 / mongodb-win32-x86_64-2008plus-v3.4-latest-signed.msi
My Baidu cloud disk Download: Link: https://pan.baidu.com/s/1FT_2mu8jJSI77UlD9SmgBg
Extract password: jkqf
Download (Previous detours brother dei, you can delete files mango DB part of the already installed)
And then the installation steps as above, except that the 3.4 version of the installation of the fast take off ah (10 seconds completed)
Three, MongoDB configuration
(1) The default installation path: C: \ Program Files \ MongoDB \ Server \ 3.4
(2) creating a data storage directory ----> db folder
After the MongoDB service starts, it will create a bunch of default db file in the root directory of the following, and we in the process of installation, mango and will not take the initiative to give us the data files and create directories, so we need to manually create, we create a data directory, and then re-create a directory under the data directory db, db folder inside, that is, when we start later mongodb database to store a lot of data files created by default
.......\data\db
(3) configure the system environment variables MongoDB
A. Add MongoDB system variables -> MGDB_HOME -> C: \ Program Files \ MongoDB \ Server \ 3.4
B. The MGDB_HOME bin directory into the system environment variables Path, pay attention not to forget the semicolon
OK, the system environment variable pause for a few seconds, the mango DB is set up, use the following into the stage
(3) run cmd, open a window, start the MongoDB service
mongod -dbpath "c:\Program Files\MongoDB\Server\3.4\data\db"
Qiaoxia Enter, wait for the service to start ....
If waiting for connections on port 27017 appears, indicating that the DB has launched mango
(4) browser to visit: http: // localhost: 27017
Server response information
(5) Another open a cmd window, use the command mongo db connection service
(6) is inserted into a recording and read
After a table if it does not exist to create, create, insert a piece of data
db.a.insert ({a: 1}) ---> successful operation Tip -> WriteResult ...--> a written record
db.a.find () ---> query all the records a table ->
(7) What is MongoDB
Sogou Encyclopedia address ---> http://baike.sogou.com/v64582605.htm
(8) Registration MongoDB service
C:\Users\Administrator>mongod -dbpath "c:\Program Files\MongoDB\Server\3.4\data\
db" -logpath "c:\Program Files\MongoDB\Server\3.4\data\logs\mongo.log" -install
Mongodb specified database log file
After a successful install, open the service for viewing MongoDB service instance (the default instance name: mongodb)
(9) does not start MongoDB service, the connection fails
(10) start the MongoDB service
net start mongodb
mongo connection
(11) stops MongoDB service
net stop mongodb
(12) Delete MongoDB service
sc delete mongodb
(13) For convenience, the script registration service writes bat file inside
---------------------
Disclaimer: This article is CSDN blogger "appleyk 'original article, follow the CC 4.0 by-sa copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/appleyk/article/details/79608404