1.hive下载安装
2.下载mysql安装
3.以root用户进入mysql命令行:mysql -uroot -p(提示输入密码)
4.创建hive用户:create user hive@‘localhost’ identified by ‘hive’【mysql中为hive专用的user名:hive,密码为:hive】
5.赋予权限:grant all privileges on *.* to hive@localhost with grant option;flush privileges;
5.登出root用户:quit;
7.使用hive用户登录mysql:mysql -uhive -phive
8.创建hive的元数据库:create database metahive【元数据库名metahive】
9.配置hive:【主要是hive-site.xml文件】
9.1.将hive的conf文件夹中的hive-default.xml.template文件拷贝为hive-site.xml文件:cp hive-default.xml.template hive-site.xml
9.2.配置hive-site.xml文件:vim hive-site.xml
需要修改的property有如下几个:【由于hive默认的元数据库为其内置的derby数据库,要修改为mysql】
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/元数据库名?createDatabaseIfNotExist=true</v