时间:2021-07-01 10:21:17 帮助过:49人阅读
一,安装MySQL sudo apt-get install mysql-server 可能还要 sudo apt-get install mysq 首先用root登陆给hive用户赋予权限 $mys
一,安装MySQL
sudo apt-get install mysql-server
可能还要
sudo apt-get install mysq
首先用root登陆给hive用户赋予权限
$mysql -u root -p111111
mysql> GRANT ALL PRIVILEGES ON *.* TO hive@localhost IDENTIFIED BY "hive123";
2,安装hive;
$ tar zxvf hive-0.8.1.tar.gz
在/etc/profile中添加;
export Hadoop_HOME=/home/sina/hadoop/
export HIVE_HOME=/home/sina/hive/
export PATH=$PATH:$HADOOP_HOME/bin:$HIVE_HOME/bin
. /etc/profile生效(.与/etc/profile之间用空格哦)
启动hive,可以用起来了吧;、
hive> create table hive1(id int ,name string)ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';
OK
Time taken: 10.865 seconds
hive> show tables;
OK
hive1
Time taken: 0.586 seconds
hive> desc hive1;
OK
id int
name string
Time taken: 0.317 seconds
hive> show tables;
OK
hive1
Time taken: 0.182 seconds
hive>
三,拷贝mysql-connector-java-5.1.13.jar到hive的lib目录下