zoukankan      html  css  js  c++  java
  • 添加Mysql普通用户来管理hive

    (一)、在root用户下:(Mysql)


    1.在root用户下:创建hive元数据库

    create database if not exists hivedb;

    2.在root用户下添加添加用户用户:hadoop

    注意:这地方主机为localhost,可以自定义主机名,比如下面的spark1,需要统一!

    insert into mysql.user(Host,User,Password)values('%','hadoop',password('hadoop'));

    3.在root用户下给普通用户hadoop授权于hivedb数据库任何主机:

    注意:dentified by 'hadoop' 表示密码

    grant all privileges on hivedb.* to 'hadoop'@'%' identified by 'hadoop';

    (二)、修改hive中的配置文件hive-site.xml


    修改前:

    <configuration>
    <property>
      <name>javax.jdo.option.ConnectionURL</name>
      <value>jdbc:mysql://192.168.137.5:3306/1608b?characterEncoding=UTF-8</value>
    </property>
    <property>
      <name>javax.jdo.option.ConnectionDriverName</name>
      <value>com.mysql.jdbc.Driver</value>
    </property>
    <property>
      <name>javax.jdo.option.ConnectionUserName</name>
      <value>root</value>
    </property>
    <property>
      <name>javax.jdo.option.ConnectionPassword</name>
      <value>root</value>
    </property>
    <property>
      <name>hive.aux.jars.path</name>
      <value>${HIVE_HOME}/auxlib</value>
    </property>
    </configuration>

    修改后:

    <configuration>
    <property>
      <name>javax.jdo.option.ConnectionURL</name>
      <value>jdbc:mysql://192.168.137.5:3306/hivedb?characterEncoding=UTF-8</value>
    </property>
    <property>
      <name>javax.jdo.option.ConnectionDriverName</name>
      <value>com.mysql.jdbc.Driver</value>
    </property>
    <property>
      <name>javax.jdo.option.ConnectionUserName</name>
      <value>hadoop</value>
    </property>
    <property>
      <name>javax.jdo.option.ConnectionPassword</name>
      <value>hadoop</value>
    </property>
    <property>
      <name>hive.aux.jars.path</name>
      <value>${HIVE_HOME}/auxlib</value>
    </property>
    </configuration>

    (三)、启动hive

  • 相关阅读:
    implement the bucket sort and some analysis
    冪運匴
    polynomial multiplication
    WinRAR(WinZip)压缩与解压实现(C#版Window平台)
    Windows 窗体计时器事件,则不引发在 Windows 服务
    VS 2008智能提示是英文的怎么改成中文的?
    C#_SQL数据访问帮助类
    C#_DllImport用法和路径问题
    Office2003/2007/2010强力卸载工具下载
    Windows_装的是2008R2系统,在电脑属性里显示内存12G(可用4G)
  • 原文地址:https://www.cnblogs.com/lishengnan/p/hadoop8.html
Copyright © 2011-2022 走看看