Steps 1: Install MySQL,mysql-connector and configure MySQL.
-> Download mysql-connector-java-5.1.30 extract it and copy mysql-connector-java-5.1.30- bin.jar to lib directory in Hive.
-> Delete log4j-slf4j-impl-2.4.1.jar jar file from lib directory which is in apache-hive-2.1.1-bin directory.
$ sudo apt-get install mysql-server
$ mysql -u root -p
$ SOURCE /home/<username>/Downloads/apache-hive-2.1.1-bin/scripts/metastore/upgrade/mysql/hive-schema-0.14.0.mysql.sql;
Step 2: Create Hiveuser and Hivepassword
mysql> CREATE USER 'hiveuser'@'%' IDENTIFIED BY 'hivepassword';
mysql> GRANT all on *.* to 'hiveuser'@localhost identified by 'hivepassword';
mysql> flush privileges;
Step 3: Configure the Metastore Service to Communicate with the MySQL Database