• Cockroachdb 四、用户管理及授权


    四 用户管理及授权

    用户管理


    简介
    # Create a user:
    cockroach user set <username> <flags>

    # List all users:
    cockroach user ls <flags>

    # Display a specific user:
    cockroach user get <username> <flags>

    # Delete a specific user:
    cockroach user rm <username>

    示例

    创建用户,及修改用户密码
    cockroach user set username --certs-dir=certs --host=127.0.0.1 --password

    列出所有用户
    cockroach user ls --certs-dir=certs --host=10.2.0.14
    +------------+
    | username |
    +------------+
    | jpointsman |
    | maxroach |
    | username |
    +------------+
    (3 rows)

    显示用户信息
    cockroach user get username --certs-dir=certs --host=10.2.0.14
    +----------+--------------------------------------------------------------+
    | username | hashedPassword |
    +----------+--------------------------------------------------------------+
    | username | $2a$10$H5.c5eQYUJJ1LW/r74NvPuDxkZXwrfeIpTk8CIbheKKRhLW0zxL1. |
    +----------+--------------------------------------------------------------+
    (1 row)

    删除用户
    cockroach user rm username --certs-dir=certs --host=10.2.0.14

    登录
    cockroach sql --certs-dir=certs --user=username --password

    授权

    简介基本语法

    GRANT role ON DATABASE database | TABLE db.table TO user

    REVORKE role ON  DATABASE database| TABLE db.table FROM user

    SHOW GRANTS ON DATABSE database|  TABLE db.table FOR user

    图例

  • 相关阅读:
    VMware安装Ghost版Win10 失败的解决方法
    供销平台能导入不能编辑商品的问题
    bootstrap导航菜单做active判断
    phantomjs读取文件转换数组
    网址收藏
    清理恶意绑定浏览器网址
    sort
    论文等级
    multiThreading
    LZ4压缩算法
  • 原文地址:https://www.cnblogs.com/zhangeamon/p/7338165.html
Copyright © 2020-2023  润新知