Software⏱️ 3 min read📅 2026-06-11

How to Fix: Hive Installation - Error Executing SQL Query "select "DB_ID" from "DBS""

Troubleshooting guide for Apache Hive installation errors.

Quick Answer: Remove conflicting SLF4J bindings to resolve the issue.

The error 'Error Executing SQL Query 'select '' from ''DBS''' occurs when trying to install Apache Hive on a Hadoop multi-node cluster. This issue affects users who have followed the official getting started tutorial but are experiencing long stacktraces in the hive.log file and console errors.

This error can be frustrating as it prevents users from accessing Hive's features, making it challenging to work with data. In this guide, we will walk through the root causes of this issue and provide step-by-step instructions for resolving it.

💡 Why You Are Getting This Error

  • The primary cause of this error is the presence of multiple SLF4J bindings in the classpath. Hive relies on specific binding configurations to function correctly. When there are multiple bindings, Hive struggles to determine which one to use, leading to errors.
  • Another possible reason for this issue is a misconfigured metastore database. The metastore database is crucial for storing Hive's metadata and queries. If it is not properly set up, Hive may fail to execute SQL queries correctly.

🚀 How to Resolve This Issue

Resolving Multiple SLF4J Bindings

  1. Step 1: Step 1: Identify the conflicting bindings in your classpath. Open the hive.log file and look for the lines indicating the presence of multiple SLF4J bindings. Take note of the jar files containing these bindings.
  2. Step 2: Step 2: Remove or exclude the conflicting binding jars from your classpath. You can do this by editing your $HIVE_HOME/conf/hive-site.xml file to remove the unnecessary bindings. For example, if you have both log4j-slf4j-impl and slf4j-log4j12 in your classpath, remove one of them.
  3. Step 3: Step 3: Restart Hive Server 2 after making changes to the hive-site.xml file. This ensures that the new configuration takes effect.

Resolving Metastore Database Issues

  1. Step 1: Step 1: Verify the metastore database configuration. Check the hive-site.xml file for any incorrect or missing settings. Make sure the metastore database is properly set up and configured.
  2. Step 2: Step 2: Check the Hive metastore database for any errors or corruption. You can do this by running the command `hive --service metaservice`. If you encounter any issues, try deleting the metastore database files and reconfiguring it.

💡 Conclusion

To resolve the 'Error Executing SQL Query 'select '' from ''DBS''' error, follow the steps outlined in this guide. By resolving the multiple SLF4J bindings issue or addressing the metastore database configuration, you should be able to access Hive's features without any errors.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions