启用mongodb授权认证

linux下

1、以–auth 启动mongod

2、在配置文件mongod.conf 中加入 auth = true

原文地址:https://www.cnblogs.com/jtlgb/p/5733563.html