Skip to main content
rrrajesh
Gold ⭐️⭐️
Gold ⭐️⭐️
Jan 4, 2018 3:22 AM UTC

Hive metastore DB Connection verification from Command line

  • Oct 5, 2026 9:14 AM UTC
  • 0 replies
  • 4647 views
  • Translate All
Hive metastore DB Connection verification from Command line:-

You can run the following on any node where ambari agent installed on the cluster,

You need the following information to run this test.

You can use this to validate if the password stored in ambari and the actual mysql db password are same.

1. mysql db hostname
2. mysql db port number
3. mysql database name which hive metastore uses
4. mysql username
5. mysql password

Syntax:-

java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar -Djava.library.path=/usr/lib/ambari-agent org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://<mysql db hostname>:<mysql db port number>/<mysql database name>" "<mysql username>" "<mysql password>" com.mysql.jdbc.Driver


Example:-

/usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/share/java/mysql-connector-java.jar -Djava.library.path=/usr/lib/ambari-agent org.apache.ambari.server.DBConnectionVerification "jdbc:mysql://test.openstacklocal:50001/hive" hive hive com.mysql.jdbc.Driver

Connected to DB Successfully!