use mydb
db.createUser( { "user" : "sa",
                 "pwd": "sa",
                 "customData" : { employeeId: 12345 },
                 "roles" : [ { role: "clusterAdmin", db: "admin" },
                             { role: "readAnyDatabase", db: "admin" },
                             "readWrite"
                             ] },
               { w: "majority" , wtimeout: 5000 } )

mongo -u sa -p sa --authenticationDatabase mydb

 

相关文章:

  • 2021-11-03
  • 2022-12-23
  • 2021-11-23
  • 2021-11-28
  • 2022-01-01
  • 2021-05-05
  • 2022-01-07
猜你喜欢
  • 2021-07-31
  • 2021-08-16
  • 2021-12-18
  • 2021-10-15
  • 2021-08-09
相关资源
相似解决方案