Install and configure Hive and MySQL

Source: Internet
Author: User
1. Install MySQLsudoapt-getinstallmysql-server. sudoapt-getinstallmysq may also need to be installed. First, use root login to grant the hive user the permission $ mys

1. install MySQL sudo apt-get install mysql-server and sudo apt-get install mysq. First, use root login to grant permissions to hive users $ mys.

1. Install MySQL
Sudo apt-get install mysql-server
And possibly

Sudo apt-get install mysq

First, use root login to grant permissions to hive users.

$ Mysql-u root-p111111
Mysql> grant all privileges on *. * TO hive @ localhost identified by "hive123 ";

2. Install hive;

$ Tar zxvf hive-0.8.1.tar.gz

Add in/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 takes effect (use a space between. and/etc/profile)


Start hive. You can use it ;,


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>


3, copy the mysql-connector-java-5.1.13.jar to the lib directory of hive

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.