Skip to content

Instantly share code, notes, and snippets.

@dotku
Last active April 15, 2016 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dotku/21c8ede5414453e8296bcf65c66cad91 to your computer and use it in GitHub Desktop.
Save dotku/21c8ede5414453e8296bcf65c66cad91 to your computer and use it in GitHub Desktop.
Create MongoDB Service in Windows (在 Windows 中安装 MongoDB 服务)

[En]

  1. You must create related path at first, C:\data\db for example.
  2. Go to your mongodb bin path, use following command to create service

mongod --logpath "C:\data\dbConf\mongodb.log" --logappend --dbpath "C:\data\db" --port 27017 --serviceName mongodb_new --serviceDisplayName mongodb_new --install

  1. Then go to windows service manager, start your mongodb_new service.

[Zh]

  1. 你必须先创建相关的文件与文件夹及,比如 C:\data\db
  2. 进入你的 mongodb 安装目录下的 bin 目录,输入以下命令

mongod --logpath "C:\data\dbConf\mongodb.log" --logappend --dbpath "C:\data\db" --port 27017 --serviceName mongodb_new --serviceDisplayName mongodb_new --install

  1. 然后进入 Service 启动 mongodb_new 这个服务就好了
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment