hive 查看用户权限
时间: 2023-10-18 13:59:23 浏览: 347
要查看Hive中用户的权限,可以使用以下命令:
1. 查看当前用户:
set system:user.name;
[1]
2. 查看当前用户在数据库中所拥有的权限:
show grant use userName on database default;
[1]
3. 给用户分配某数据库建表权限:
grant create on database default to user hadoop;
[1]
4. 查看用户在某数据库的权限:
show grant user hadoop on database default;
[1]
另外,还可以通过Hive的配置文件来给所有用户添加权限:
- 给所有用户添加所有权限:
<property>
<name>hive.security.authorization.createtable.owner.grants</name>
<value>ALL</value>
</property>
[2]
- 给所有用户添加查询和删除表或分区权限:
<property>
<name>hive.security.authorization.createtable.owner.grants</name>
<value>select,drop</value>
</property>
[3]
以上是查看Hive用户权限的方法和配置信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Hive权限管理](https://blog.csdn.net/SW_LCC/article/details/100109015)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文