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