Support Questions
Find answers, ask questions, and share your expertise

Re: Hive Metastore Not able connect MYSQL database while installation Hive Service

@zkfs

Are you able to connect mysql using hive user and password?

try this first?

mysql -u <hive db user> -p <hive db user password>

Re: Hive Metastore Not able connect MYSQL database while installation Hive Service

Expert Contributor

Please find information as below

[root@centos2 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| hive               |
| mysql              |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)

mysql>


Re: Hive Metastore Not able connect MYSQL database while installation Hive Service

you are able to connect mysql with root user, please try with hive user as well for connecting hive DB.

Re: Hive Metastore Not able connect MYSQL database while installation Hive Service

Explorer

I also faced the same issue.Found the issue was with mysql-connector-java.jar. I followed the below steps 

1. Check whether you are able to connect remotely to mysql database.

2.If you are able to connect , then , its mysql-connector-java.jar in ambari

3. Download the correct version of mysql jar from https://dev.mysql.com/downloads/connector/j/

4. Stop ambari server .

5.Remove the mysql connector jar from ambari

6. Set up again using

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/ mysql-connector-java-8.0.16