linux hive mysql_Linux下的Hive与Mysql安装
一,安裝MySQL
sudo apt-get install mysql-server mysql-client
1). 建立數(shù)據(jù)庫(kù)hive,
create database hive;
2). 創(chuàng)建用戶hive
create user ‘hive’@’%’ identified by ‘hive’;
3).創(chuàng)建hive用戶,并授權(quán)
grant all on hive.* to hive@’%’ identified by ‘hive’;
flush privileges
在啟動(dòng)mysql時(shí)可能遇到的問(wèn)題:
解決方法:
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
二,Hive的安裝:
這里我安裝的Hivede 的版本是1.2.1的。
我安裝在根目錄的software下
hadoop@master:/software/apache-hive-1.2.1-bin/bin$ sudo gedit hive-config.sh
在最后加三行
export JAVA_HOME=/software/jdk1.7.0_80
export HIVE_HOME=/software/apache-hive-1.2.1-bin
export HADOOP_HOME=/software/hadoop-2.6.4
首先cp hive-site.xml:
修改hive-site.xml文件 javax.jdo.option.ConnectionURL
jdbc:mysql://master:3306/hive?createDatabaseInfoNotExist=true
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
javax.jdo.option.ConnectionUserName
hive
javax.jdo.option.ConnectionPassword
hive
. 添加環(huán)境變量etc/profile
export HIVE_HOME=/software/apache-hive-1.2.1-bin
export PATH=HIVEHOME/bin:PATH
5.MySQL 驅(qū)動(dòng)包
下載mysql-connector-java-5.0.6-bin.jar文件,并放到$HIVE_HOME/lib目錄下
啟動(dòng)Hive
hadoop@master:/software/apache-hive-1.1.1-bin$ bin/hive
如果碰到下面問(wèn)題:是由于版本不兼容,hadoop是2.6.4.的只能搭載
0.9以下hive版本,這里是hive1.2.1所以需要?jiǎng)h掉一個(gè)包。
解決方法:
然后,resource 這個(gè)文件或重啟虛擬機(jī)
就可以了。
測(cè)試:
hive> create table fristtable (key string);
OK
Time taken: 1.414 seconds
hive> show tables;
OK
fristtable
test
Time taken: 0.142 seconds, Fetched: 2 row(s)
hive>
總結(jié)
以上是生活随笔為你收集整理的linux hive mysql_Linux下的Hive与Mysql安装的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
                            
                        - 上一篇: oracle磁带的使用期限,rman删除
 - 下一篇: 计算机内部程序代码,计算机为什么能够读懂