1.Download hive package and uncompress it.
2.Create hive-site.xml under conf path, config params like that:
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>111111</value>
</property>
</configuration>
3. Edit ~/.bashrc, add hive path.
4.Execute hive, then you will entrance hive mode, then you can create table, load data and so on.
some comands like:
hive> create table user (userid int,username string,userage int,usersex string) row format delimited fields terminated by ',';
hive> show tables;
hive> desc user;
hive> load data local inpath '/data' overwrite into table user;
hive> select * from user;
5.You should use mysql-connector-java-**.jar package to connect to mysql, so you need download and put it to /hive/lib path.
本文详细介绍了如何下载并解压Hive包,配置hive-site.xml文件以连接到MySQL数据库,包括设置JDBC连接参数。同时,文章还提供了编辑.bashrc文件添加Hive路径的方法,以及使用Hive命令创建表、加载数据等操作示例。
1万+

被折叠的 条评论
为什么被折叠?



