MongoDB常用命令
前提已将mongodb注册为服务
启动服务
systemctl start mongodb.service
关闭服务
systemctl stop mongodb.service
开机启动
systemctl enable mongodb.service
LINUX环境下,可以通过查看端口27017的状态查看mongod是否已经启动。
netstat -lanp | grep "27017"
删除用户
db.system.users.remove()
查看所有用户
db.system.users.find()
shell中关闭mongodb
use admin
db.shutdownServer()
参考:
https://blog.csdn.net/qq_35562291/article/details/98204964
欢迎交流!