操作步骤

#登录
[root@xxx01 ~]# su postgres
bash-4.2$ psql -U postgres
could not change directory to "/root"
psql (9.2.24)
Type "help" for help. postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+-----------+---------+-------+-----------------------
metastore | hive | UTF8 | C | C |
postgres | postgres | SQL_ASCII | C | C |
scm | scm | UTF8 | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C | C |
(5 rows)
#删除存留的hive数据库
postgres=# drop database metastore;
DROP DATABASE
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+-----------+---------+-------+-----------------------
postgres | postgres | SQL_ASCII | C | C |
scm | scm | UTF8 | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C | C |
(4 rows) ## 创建用户是hive
postgres=# create user hive password 'hive123'; ## 创建数据库metastore 拥有者hive
postgres=# create database metastore owner hive;
CREATE DATABASE
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+-----------+---------+-------+-----------------------
metastore | hive | UTF8 | C | C |
postgres | postgres | SQL_ASCII | C | C |
scm | scm | UTF8 | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C | C |
(5 rows)
## 权限
postgres=# grant all on database metastore to hive;
GRANT
postgres=#

最新文章

  1. softwareTesting_work2_question1
  2. Hibernate—— 一对多 和 多对多关联关系映射(xml和注解)总结(转载)
  3. Activity启动清空原任务栈
  4. 如何实现ZBrush 4R7中按钮颜色的自定义
  5. C++vector迭代器失效的问题
  6. ExtJs学习笔记之学习小结LoginDemo
  7. linux 配置ssh免密码登录
  8. Spring AOP简介
  9. Linux free -m 详细说明
  10. c++重载、覆盖和隐藏
  11. (转)一步一步学习PHP(3)——函数
  12. 【转】Android:ListView常见错位之CheckBox错位
  13. C# DateTime.Now 用法小记
  14. 斯坦福ML公开课笔记15—隐含语义索引、神秘值分解、独立成分分析
  15. Sql Server XML
  16. Failed to load driver class com.mysql.jdbc.Driver from HikariConfig class classloader sun.misc.Launcher$AppClassLoader@18b4aac2
  17. OKHttp使用详解
  18. 2月第3周业务风控关注|上海网信办复测23个被约谈APP 涉及1号店、小红书等
  19. 自学Linux Shell16.2-函数中使用变量
  20. Linux内核空间内存申请函数kmalloc、kzalloc、vmalloc

热门文章

  1. 每天进步一点点------Allegro 动态显示走线长度
  2. 美化传奇NPC对话框添加图片显示实列
  3. 【NS-3学习】ns3-模拟基础:关键概念,日志,命令行参数
  4. iview修改table组件实现循环向上滚屏
  5. Multisim 之逻辑转换仪
  6. 【visio】跨职能流程图
  7. 【代码总结】Spring MVC数据校验
  8. linux shell seq命令详解
  9. pip install 安装指定版本的包
  10. C语言中调用运行python程序