zoukankan      html  css  js  c++  java
  • linux下postgres创建hive数据库

    操作步骤

    #登录
    [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=# 
    
  • 相关阅读:
    spring四种依赖注入方式
    java利用反射来调用一个类的私有方法
    IOC和AOP的基本概念
    开业大吉
    1752年9月奇怪的日历
    找到一个软件测试的学习网址,保留一下
    学习任务
    操作系统的第一次作业
    答题
    第四章读后感
  • 原文地址:https://www.cnblogs.com/JuncaiF/p/12374259.html
Copyright © 2011-2022 走看看