cmd手动启动及关闭mongoDB数据库

启动mongoDB数据库

>cd software\MongoDB\bin
>net start mongodb
请求服务已启动
d:\mongodb\bin>mongo

现在就已经链接成功了,之后就是对mongodb进行的一系列操作。

关闭 MongoDB 服务

首先需要切换到admin权限

> use admin;
switched to db admin
> db.shutdownServer();
Wed Nov 14 06:07:33 DBClientCursor::init call() failed
Wed Nov 14 06:07:33 query failed : admin.$cmd { shutdown: 1.0 } to: 127.0.0.1:27017
server should be down...
Wed Nov 14 06:07:33 trying reconnect to 127.0.0.1:27017
Wed Nov 14 06:07:33 reconnect 127.0.0.1:27017 failed couldnt connect to server 127.0.0.1:27017

猜你喜欢

转载自blog.csdn.net/chern1992/article/details/78974786