Ubuntu下mysql调试hive_ubuntu14.04使用MySQL数据库安装配置Hive 1.2.1

本文详细介绍了在Ubuntu 14.04上使用MySQL数据库配置Hive 1.2.1的过程,包括解压Hive、设置环境变量、修改hive-site.xml配置文件以及启动Hive时遇到的问题和解决办法。通过此教程,读者可以成功连接Hive与MySQL,并进行简单的Hive表操作。
摘要由CSDN通过智能技术生成

ubuntu14.04使用MySQL数据库安装配置Hive 1.2.1

一.准备Mysql已经安装好。本人装的是navicat,图形化界面。

并在本地用root用户建立了test数据库

二.安装Hive

•解压Hive

•tar zxvf  apache-hive-1.2.1-bin.tar.gz

•建立软连接

•sudo ln –s apache-hive-1.2.1 current

•添加环境变量

•export HIVE_HOME=/opt/hive/current

•export PATH=….HIVE_HOME/bin:$PATH:.

修改hive-site.xml

javax.jdo.option.ConnectionURL

jdbc:mysql://localhost:3306/test

javax.jdo.option.ConnectionDriverName

com.mysql.jdbc.Driver

javax.jdo.option.ConnectionPassword

hive

hive.hwi.listen.port

9999

This is the port the Hive Web Interface will listen on

datanucleus.autoCreateSchema

false

datanucleus.fixedDatastore

true

hive.metastore.local

true

controls whether to connect to remove metastore server or open a new metastore server in Hive Client JVM

三.启动hive

错误:FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Failed to create database ‘metastore_db‘, see the next exception for details.

原因是在同一个目录下面 开启了2个终端。

而你上次在一个目录进入hive 建立了一张表  下次在另外一个目录下面登录。

则上次建立的表 在这次登录中是无法被发现的。

解决办法就是在同一个目录下操作Hive就OK了。

四.再次命令行键入

•hive

Logging initialized using configuration in jar:file:/home/test/Desktop/hive-0.8.1/lib/hive-common-0.8.1.jar!/hive-log4j.properties

Hive history file=/tmp/test/hive_job_log_test_201208260529_167273830.txt

hive>

测试语句

•建立测试表test

•create table test (key string);

•show tables;

安装ok lalala.

原文:http://www.cnblogs.com/PursuitOnly/p/5007716.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值