#新安装3.以上
1.#添加账号管理权限的账号
#use admin
#db.system.users.find() #查看默认用户
#db.dropUser('admin') #删除默认用户
#db.system.version.update({"_id":"authSchema"},{$set:{"currentVersion":3}}) #修改currentVersion为3
#创建认证用户
#db.createUser({user:"user",pwd:"123456",roles: [ { role: "userAdminAnyDatabase", db: "admin"},{ role: "readWrite", db: "kkk"}]})
#db.auth("user","123456") #认证
#第二用户
#db.createUser({user:"mongotest",pwd:"123456",roles: [{ role: "readWrite", db: "test"}]})
#db.auth("mongotest","123456") #认证
#client
#mongo --host 10.27.54.67 --authenticationDatabase admin -u mongouser -p 123456