在启动MongoDB的时候加入–auth命令

在进入MongoDB数据库时用命令db.auth(“user”,”pwd”)登陆