.\mongod.exe --config "D:\Program Files\MongoDB\Server\3.4\mongo.conf" --install
使用命令安装mongodb的时候报错:
2020-01-09T10:50:01.415+0800 I CONTROL [main] ***** SERVER RESTARTED *****
2020-01-09T10:50:01.864+0800 I CONTROL [main] Trying to install Windows service 'MongoDB'
2020-01-09T10:50:01.864+0800 I CONTROL [main] Error connecting to the Service Control Manager: 拒绝访问。 (5)
原因:cmd没有权限,要使用管理员界面。
安装好后启动服务,访问,表示启动成功: