Install mongoDB in windows and mongodb in windows
1. Original Intention
This is so simple that I have been thinking about whether to write an article for a long time. However, for beginners, anything they have never touched may become a stumbling block, therefore, this blog aims to pave the way for record, rather than display level.
2. Download
Search for the keyword 'mongodb 'in Baidu or google, find and open the official website, click the open link, and click Download mongodb on the right. As of this article, no 64-bit windows version has been found, therefore, during the download process, both 64-bit and 32-bit windows versions download the 32-bit version and the msi installation package. Another URL is mongodb native driver 1.x: Click to open the link.
3. Install
Run the installation package directly and install it in the default path. The directory must be C: \ Program Files \ MongoDB 2.6 Standard.
4. Start directly
Run the console, cd to the C: \ Program Files \ MongoDB 2.6 Standard \ bin path, and then run the following:
> Mongod -- dbpath D: \ MongoDB
Note that the path followed by this path should be in full English, and it is best not to contain Chinese Characters
If you want to start the mongoDB shell command line, run
> Mongo
5. bat startup
Every time I enter the directory of a drive C and start mongoDB through running the console, it is quite troublesome, so we can write a STARTUP script.
As follows:
C: \ "Program Files" \ "MongoDB 2.6 Standard" \ bin \ mongod -- dbpath D: \ MongoDB \ data
Pause
It is worth noting that there is no space in the startup script. If there is a space in a directory, use "" to include it. pause is used to prevent the console from being automatically closed. The paths here are all absolute paths.
You can also start mongo shell to write a bat file, as shown below:
C: \ "Program Files" \ "MongoDB 2.6 Standard" \ bin \ mongo
Pause