Mysql database installation and configuration

1.Download and install and its dependencies.
2.Initialize db with command

connect to mysql with command

3.It will prompt for a password as we have not given any password.Enter MySQL with the same mode and update the password

4.Now start up MySQL in safe mode, so you’ll skip the privileges table:

5. Assign the DB that needs to be used:

6. Reset root password. 

Now all you have to do is reset your root password of the MySQL user and restart the MySQL service:

7.Quit and restart MySQL:

8. Validate root password:

Now your root password should be working with the one you just set, check it with:

9. Create Hive user and Hivepassword:

10. Modify the derby configuration files:

Get into conf directory under apache-hive-2.1.1-bin folder and edit the derby configurations in below files

1.In hive-site.xml

Change following properties
a) ConnectionURL
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost/metastore_db?createDatabaseIfNotExist=true</value>
b) ConnectionUserName
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
c) ConnectionPassword
<name>javax.jdo.option.ConnectionPassword</name>
<value>tcstcs123</value>
d) ConnectionDriver
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>

11. $schematool -initSchema -dbType mysql

12. connect to hive or hiveserver2