Http://www.cnblogs.com/best/p/6212807.html
Open the MongoDB installation directory such as "C:\Program Files\mongodb\server\3.4\bin" and create a new Mongo.config file in this directory with the following file contents:
# #数据库目录 # #dbpath =c:\data\db# #日志输出文件 # #logpath =c:\data\log\db.log
Use CMD to enter the command line
Use the CD to switch directories to the installation directory, such as: CD C:\Program Files\mongodb\server\3.4\bin
Install the MongoDB service and specify the configuration file, such as:
Mongod--config "C:\Program files\mongodb\server\3.4\bin\mongo.config"--install
Http://www.cnblogs.com/yjq-code/p/6880625.html
There is no auth way to register and start the service, but this is not safe, generally start the service when the start of the Auth way, we will now create a new administrator user, in order to later start the service Auth way to prepare.
Input command: MONGO
Then enter the command in turn:
Use admin
Db.createuser ({User: "Yjq", pwd: "123456", roles:[{"role": "Useradmin", "db": "admin"},{"role": "Root", "db": "Admin"},{ "Role": "Useradminanydatabase", "db": "Admin"}]})
Be careful to change the corresponding user and pwd to the value you want.
Authorization to Account: Db.auth ("Yjq", "123456")
At this end a simple account authorization is over. Description of permissions See MongoDB 3.X User Rights control
MongoDB installation, Windows services, creating users