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=# 
    
  • 相关阅读:
    时间选择器UIDatePicker的使用
    在app中屏蔽第三方键盘
    plist文件的相关操作
    查看mac上的隐藏文件
    设置ARC有效或者无效
    Linux 下源代码安装编译 ImageMagick6.8.48 且使其支持 JPEG
    Linux Netcat 命令—网络工具中的瑞士军刀
    Linux 好书、经典书籍推荐
    让你拥有超能力:程序员应该掌握的统计学公式
    shell 脚本实现的守护进程
  • 原文地址:https://www.cnblogs.com/JuncaiF/p/12374259.html
Copyright © 2011-2022 走看看