Environment: Win8 32bit
1: Installation
Go to MongoDB's official website http://www.mongodb.org/downloads Download 32bit Package
The following files will appear after decompression
Under the installed disk C: Create a MongoDB folder, copy the bin folder to this directory, which is equivalent to the installation of MongoDB related commands.
In order to start MongoDB convenient, add Mongod.exe path to environment variable, computer----Advanced system settings--environment variable, add path in path:
This allows the Mongod command to be used anywhere in the command line.
2: Set up data file and start up
Then create a new MongoDB folder on the D drive to place the data file and create the Data,log folder under the MongoDB folder, and create the Mongodb.log file under the log folder.
Start MongoDB Service: Open command Line Input command
>mongod--dbpath "D://mongodb//data"--logpath "D://mongodb//log//mongodb.log"--logappend
The following behavior occurs when the 27017 port starts successfully.
Resolution: Mongod--dbpath command is to create a database file storage location, the start of the MongoDB service needs to determine the location of the database files, or the system will not be automatically created, startup will not be successful.
--logpath indicates that the log file is stored in a path--logappend means that the log file is written in an appended way
You will see this message on your browser:
The default port of 27017, you can also modify the port through the--port command, such as: Mongod--port 9888 "D:\\mongodb\\data"
3: Start by service mode
Each time you start the service you need to enter the above command, for convenience, you can write the startup database as a window service.
>mongod--logpath "D://mongodb//log//mongodb.log"--logappend--dbpath "D://mongodb//data"-- Directoryperdb--servicename MongoDB--install
This only needs to enter the net start MongoDB at the command line can start the service, but do not know what reason, I set this, in the "service", also can't find MongoDB?