1.创建管理用户

db.createUser(
   {
     user: "accountUser",
     pwd: "password",
     roles: [ "readWrite", "dbAdmin" ]
   }
)

2.删除用户

db.dropUser("accuntUser")

3.修改用户密码

db.changeUserPassword("accuntUser","newPasswd")

4.启动数据库:

mongod --bind_ip localhost --port 27017 --dbpath /home/raid1/z_BAK/mongod_data/ --logpath=/var/log/mongod.log --fork