zoukankan      html  css  js  c++  java
  • dbAdmin 不等于 root 集合中角色

    dbAdmin  root  集合中角色

    use admin
    创建
    db.createUser(
    {
    user: "tmp_rw_56756",
    pwd: "tmp4242vdfd",
    roles: [ "readWrite", "dbAdmin" ]
    }
    )

    repl_test:PRIMARY> db.system.users.find({})
    { "_id" : "admin.admin", "user" : "admin", "db" : "admin", "credentials" : { "SCRAM-SHA-1" : { "iterationCount" : 10000, "salt" : "V7VYUNDGexgVnKhvR1CWKQ==", "storedKey" : "H0gAXeCe1Twfqv6psI9+9Ul3bXI=", "serverKey" : "etgetLycgvSVeDJlWR6XFcikF3o=" } }, "roles" : [ { "role" : "root", "db" : "admin" } ] }
    { "_id" : "personas.guest", "user" : "guest", "db" : "personas", "credentials" : { "SCRAM-SHA-1" : { "iterationCount" : 10000, "salt" : "CEEWhTzFVPuqVP0/WkLs4w==", "storedKey" : "gvaXHeevGTGa0ptc0OyokS1SXXo=", "serverKey" : "ZfXCqeLKqnrzlpbcvFIOFpCP/zw=" } }, "roles" : [ { "role" : "read", "db" : "personas" } ] }
    { "_id" : "admin.tmp_rw_56756", "user" : "tmp_rw_56756", "db" : "admin", "credentials" : { "SCRAM-SHA-1" : { "iterationCount" : 10000, "salt" : "4oNrmGqCe+tISkmz7zGadg==", "storedKey" : "81P26DcNYgDWJaDlho4IOTt+d50=", "serverKey" : "6PCv81p747XO1FCInHof7U6RXS8=" } }, "roles" : [ { "role" : "readWrite", "db" : "admin" }, { "role" : "dbAdmin", "db" : "admin" } ] }
    repl_test:PRIMARY>

    删除用户
    repl_test:PRIMARY> db.runCommand( {
    ... dropUser: "tmp_rw_56756",
    ... } )
    { "ok" : 1 }
    repl_test:PRIMARY> db.system.users.find({})
    { "_id" : "admin.admin", "user" : "admin", "db" : "admin", "credentials" : { "SCRAM-SHA-1" : { "iterationCount" : 10000, "salt" : "V7VYUNDGexgVnKhvR1CWKQ==", "storedKey" : "H0gAXeCe1Twfqv6psI9+9Ul3bXI=", "serverKey" : "etgetLycgvSVeDJlWR6XFcikF3o=" } }, "roles" : [ { "role" : "root", "db" : "admin" } ] }
    { "_id" : "personas.guest", "user" : "guest", "db" : "personas", "credentials" : { "SCRAM-SHA-1" : { "iterationCount" : 10000, "salt" : "CEEWhTzFVPuqVP0/WkLs4w==", "storedKey" : "gvaXHeevGTGa0ptc0OyokS1SXXo=", "serverKey" : "ZfXCqeLKqnrzlpbcvFIOFpCP/zw=" } }, "roles" : [ { "role" : "read", "db" : "personas" } ] }
    repl_test:PRIMARY>


    更新用户密码

  • 相关阅读:
    redis学习--Hashes数据类型
    redis学习--String数据类型。
    redis学习一
    redis命令大全
    MongoDB学习笔记(索引)
    ECharts的使用(经典博客)
    php中五种常见的设计模式
    实用的借口
    php中socket的使用
    jquery仿凡客诚品图片切换的效果实例代码
  • 原文地址:https://www.cnblogs.com/rsapaper/p/10191479.html
Copyright © 2011-2022 走看看