MongoDB installs Windows a bit
https://www.mongodb.org/downloads?_ga=1.207888916.746558625.1410501054
Download, note version 64,32
Direct MSI installation, select the installation path, D:\MongoDB
Then there will be a file when the installation is complete
Bin,gnu-agpl-3.0,readme,third-party-notices
Then create a new data in this directory, which is responsible for placing the MongoDB data, and then adding the bin to the system environment variable
Mongod--dbpath D:\MongoDB\data, add data
This time MongoDB is running with the current CMD, turn off the cmd Shell,mongo to stop running, do you want a background run?
Fork This command seems to be only available under Linux
C:\users\administrator>mongod--logpath "D:\MongoDB\data\mongodb.log"--logappend--dbpath "D:\MongoDB\data"-- ServiceName "Netmongo"--install
In the Task Manager service interface, you can see the
Enter URL http://localhost:27017/try it.
Specific parameter description
Note that you must have administrative privileges to run the following command. Execute the following command to run the MongoDB server as a Windows service:
Mongod--bind_ip youripadress--logpath "C:\data\dbConf\mongodb.log"--logappend--dbpath "C:\data\db"--port Yourportnumber--servicename "Yourservicename"--servicedisplayname "Yourservicename"--install
The following table describes the parameters for MongoDB startup:
Parameters |
Description |
--bind_ip |
Bind service IP, if bind 127.0.0.1, can only native access, do not specify default local all IP |
--logpath |
Specify the MongoDB log file, note that the specified file is not a directory |
--logappend |
Write a log using an Append method |
--dbpath |
Specify the database path |
--port |
Specifying the service port number, default port 27017 |
--servicename |
Specify the service name |
--servicedisplaynam |
Specifies the service name that is executed when there are multiple MongoDB services. |
--install |
Specifies the installation as a Windows service. |
You can also see the relevant content in the Mongodb.log under data
FLASK under the operation of MongoDB can refer to this article, this is the use of Pymongo
Http://www.pythondoc.com/flask-pymongo/index.html
MongoDB installs Windows a bit