1、使用yum安装mysql server。
yum install -y mysql-server
service mysqld start
chkconfig mysqld on
2、使用yum安装mysql connector
yum install -y mysql-connector-java
3、将mysql connector拷贝到hive的lib包中
cp/usr/share/java/mysql-connector-java-5.1.17.jar /usr/local/hive/lib
4、在mysql上创建hive元数据库,创建hive账号,并进行授权
create database if not existshive_metadata;
grant all privileges onhive_metadata.* to 'hive'@'%' identified by 'hive';
grant all privileges onhive_metadata.* to 'hive'@'localhost' identified by 'hive';
grant all privileges onhive_metadata.* to 'hive'@'spark1' identified by 'hive';
flush privileges;
use hive_metadata;