linux hive创建数据库失败,linux下postgres创建hive数据库

操作步骤

#登录

[[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=#

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值