首页 > 数据库技术 > 详细

linux下postgres创建hive数据库

时间:2020-02-27 21:19:35      阅读:32      评论:0      收藏:0      [点我收藏+]

标签:databases   ner   data   help   hive数据库   ant   

操作步骤

#登录
[[email protected] ~]# 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=# createdb -U hive metastore
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)
## 拥有者
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=# 

linux下postgres创建hive数据库

标签:databases   ner   data   help   hive数据库   ant   

原文:https://www.cnblogs.com/JuncaiF/p/12374259.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 bubuko.com 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号