Home > Database > Mysql Tutorial > body text

Hive与MySQL安装配置

WBOY
Release: 2016-06-07 17:25:05
Original
1225 people have browsed it

一,安装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目录下

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!