Guide to install and run Hive 3.1.2 on Windows 10

Adithya S.T.
Republic of Coders — India
3 min readMay 20, 2021


Hive is a database which runs on top of Hadoop and provides functionalities like data warehouse and data analysis. It provides an SQL-like interface to interact with the databases. In this article I’ve compiled the steps to install and run Hive with Hadoop on Windows 10

1. Pre-requisites:

Install Hadoop by following this guide:

Download Apache Derby Binaries:

Hive requires a relational database like Apache Derby to create a Metastore and store all metadata

Download the derby tar file from the following link:

Extract it to the location where you have installed Hadoop

2. Download Hive binaries:

Download Hive binaries from the following link:

Extract it to the location where you have installed Hadoop

3. Setting up Environment variables:

Type ‘environment’ in Windows Search Bar

Click on Environment Variables

Click on New

Add the following variables:

HIVE_HOME: E:\hadoop-3.1.0\apache-hive-3.1.2-bin

DERBY_HOME: E:\hadoop-3.1.0\db-derby-

HIVE_LIB: E:\hadoop-3.1.0\apache-hive-3.1.2-bin\lib

HIVE_BIN: E:\hadoop-3.1.0\apache-hive-3.1.2-bin\bin


In Path Variable in User Variables add the following paths:



Now in System Variables add the following:


4. Configuring Hive:

Copy Derby Libraries:

Copy all the jar files stored in Derby library files stored in:


And paste them in Hive libraries directory:


5. Configuring Hive-site.xml:

Create a new file with the name hive-site.xml in E:\hadoop-3.1.0\apache-hive-3.1.2-bin\conf

Add the following lines in the file

<?xml version=”1.0"?>
<?xml-stylesheet type=”text/xsl” href=”configuration.xsl”?>
<configuration><property> <name>javax.jdo.option.ConnectionURL</name>
<description>JDBC connect string for a JDBC metastore</description>
<description>Driver class name for a JDBC metastore</description>
<description>Enable user impersonation for HiveServer2</description>
<description> Client authentication types. NONE: no authentication check LDAP: LDAP/AD based authentication KERBEROS: Kerberos/GSSAPI authentication CUSTOM: Custom authentication provider (Use with property hive.server2.custom.authentication.class) </description>
<value>true</value> # change false to true

6. Starting Services:

Start Hadoop Services:

Change the directory in terminal to the location where Hadoop is stored and give the following command:


Start Derby Network Server:

Start the Derby Network Server with the following command:

StartNetworkServer -h

Initialize Hive Metastore:

Give the following command to initialize Hive Metastore:

hive --service  schematool -dbType derby -initSchema

Start Hive Server:

hive --service hiveserver2 start

Start Hive:

Start hive by giving the following command:


Installation Done ✌