Always feel that the configuration of the environment is a super troublesome thing Ah, and the online said is more chaotic, after the configuration has not said how to start running, in which input additions and deletions to change the statement, like a sudden fault. So here's a detailed talk.
One: Download and install
1, to the official website of the download page
2, after downloading is an EXE installation program, as long as you have to press next. Used to be a compressed package, now a lot of convenience, but the default installation path is C:\Program Files\mongodb (I am solid state Drive, hehe)
Two: Create the Data folder and set the data path in cmd
1, I directly in the MongoDB bin file inside the Data folder set, the database is placed inside.
2. Then open cmd, enter into the Bin folder under the MongoDB installation directory, execute Mongod--dbpath (absolute path of data)
Because my data file is in the current directory (Bin folder), so there is no need to hit the path (hehe).
3. Observe the cmd output:
There was a remark that had been ok!
4, in the browser input http://localhost:27017/
That means it's done! If you don't succeed, you won't find the page.
Three, Configuration complete
1, this time the data folder has generated a lot of things (we do not care)
2, at this time directly shut down the CMD can, now we have been configured.
Iv. Use of MongoDB
1. Open the Mongod.exe file in the bin directory
This is what happens when you open the MongoDB database, and the program stays open when you use the database. (whatever else is not in the tube)
2. Open Mongo.exe
Use mongdb here, and write the statement.
Example (a Find statement):
OK, I believe MongoDB installation configuration and use everyone has learned it ~
MongoDB environment configuration and use under Windows (full plot)