zoukankan      html  css  js  c++  java
  • Hive之权限控制

    Hive之权限

    一、库级的权限

    -- 授予所有权限给某个用户
    grant all on msta to user {userName};
    -- 授权admin privilege权限
    grant ADMIN PRIVILEGE on database {dbName} to user {userName};
    
    -- 授予某个库的权限给某个用户
    grant select on database {dbName} to user {userName};
    grant insert on database {dbName} to user {userName};
    grant update on database {dbName} to user {userName};
    grant delete on database {dbName} to user {userName};
    
    -- 回收某个库的权限给某个用户
    revoke select on database {dbName} from user {userName};
    revoke insert on database {dbName} from user {userName};
    revoke update on database {dbName} from user {userName};
    revoke delete on database {dbName} from user {userName};
    
    -- 查看指定用户在所有库下面的权限
    show grant user {userName};
    -- 查看指定用户在某个库的权限
    show grant user {userName} on database {dbName};

    二、表级的权限

    -- 授予表的权限给某个用户
    grant create on database {dbName} to user {userName};
    grant select on table {dbName}.tableName to user {userName};
    grant insert on table {dbName}.tableName to user {userName};
    grant update on table {dbName}.tableName to user {userName};
    grant delete on table {dbName}.tableName to user {userName};
    
    
    -- 回收某个用户的表的权限
    revoke create on table {dbName}.tableName from user {userName}; 
    revoke select on table {dbName}.tableName from user {userName};
    revoke insert on table {dbName}.tableName from user {userName};
    revoke update on table {dbName}.tableName from user {userName}; 
    revoke delete on table {dbName}.tableName from user {userName};
    
    -- 查看指定用户在指定表的权限
    show grant user {userName} on table {dbName}.{tableName};

    -- 设置session具有Admin权限
    set role admin;

    ALTER  更改表结构,创建分区
    CREATE  创建表
    DROP  删除表,或分区
    INDEX  创建和删除索引
    LOCK  锁定表,保证并发
    SELECT  查询表权限
    SHOW_DATABASE  查看数据库权限
    UPDATE  为表加载本地数据的权限

    做自己的太阳,成为别人的光!
  • 相关阅读:
    响应式设计的 5 个 CSS 实用技巧
    iframe的高度自适应的方法
    HDOJ1285 比赛排名(拓扑排序)
    GENIA项目GENIA语料库
    HDOJ1102 修路问题(最小生成树Prim)
    二叉树的一些操作
    GENIA项目综述论文(E99)
    GENIA项目主页
    读《统计自然语言处理》有笔记——语料库与知识词汇库
    HDOJ2535 ( Vote ) 【水题】
  • 原文地址:https://www.cnblogs.com/botaoli/p/14627727.html
Copyright © 2011-2022 走看看