hive安装

第一步:上传文件,并解压 tar -zxvf apche-hive_… -C /usr/local/
第二部:cd 到hive目录下的conf 文件,修改配置

vi hive-site.xml

<configuration>
	<property>
		<name>javax.jdo.option.ConnectionURL</name>
		<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
		<description>JDBC connect string for a JDBC metastore</description>
	</property>
	
	<property>
		<name>javax.jdo.option.ConnectionDriverName</name>
		<value>com.mysql.jdbc.Driver</value>
		<description>Driver class name for a JDBC metastore</description>
	</property>
	
	<property>
		<name>javax.jdo.option.ConnectionUserName</name>
		<value>root</value>
		<description>username to use against metastore database</description>
	</property>
	
	<property>
		<name>javax.jdo.option.ConnectionPassword</name>
		<value>123456</value>
		<description>password to use against metastore database</description>
	</property>
</configuration>

第三部:上传mysql的依赖jar包 ,到hive的lib目录下
第四部:启动mysql (授权之后的mysql)
第五步:配置环境变量
第六部:启动hive

启动后显示列名:

set hive.cli.print.header=true;
set hive.resultset.use.unique.column.names=false;

posted @ 2019-06-04 16:19  drl_blogs  阅读(102)  评论(0编辑  收藏  举报