Home  >  Article  >  Database  >  Win7下MongoDB安装初始配置

Win7下MongoDB安装初始配置

WBOY
WBOYOriginal
2016-06-07 16:13:25988browse

一、下载 二、安装 下载下来之后解压在没有空格的目录中,我的目录是D:\Program Files\MongoDB\ 然后windows开始里面输入CMD,选择cmd.exe 右键选择以管理员身份运行(这点很重要,因为如果默认用户不是超级管理员那么没有办法将MongoDB安装为服务) 然后切

一、下载

二、安装

下载下来之后解压在没有空格的目录中,我的目录是D:\Program Files\MongoDB\

然后windows开始里面输入CMD,选择cmd.exe 右键选择以管理员身份运行(这点很重要,因为如果默认用户不是超级管理员那么没有办法将MongoDB安装为服务)

\

 

然后切换到安装目录\bin 目录下面

 

\

然后输入: mongod --logpath "D:\Program Files\Mongo

DB\Server\3.0\data\log\MongoDB.log"--logappend --dbpath "D:\Program Files\Mongo

DB\Server\3.0\data\db" --serviceName"MongoDB" –install

这样便可将mongoDB安装为服务。

这里需要注意:

1、 logpath 参数不是目录而是一个log文件名。

2、 命令里面的目录及文件都必须存在,否是执行后会报错。

\

 

三、启动

命令执行后服务就建立好了,但没有启动。可以去系统服务里面找到它(服务名就说serviceName 的对应参数)。

如果在服务里面没有找到,那么请参照第二步里面以超级管理员身份进行之后的操作。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn