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

Beeline- Unable to connect to a hive2server

Hi, I am new to hadoop and i am facing a problem of connection to hive2

I first type "beeline" i get its version. [hive@sandbox root]$ beeline Beeline version 1.2.1000. by Apache Hive

I tried the following command to connect to the database foodmart in hive2 beeline> beeline -u "jdbc :hive2://localhost:10000/foodmart" beeline> show tables; No current connection

I am still having "no current connection"

What is the good command for this connection?


Thanks for your response.


After typing "beeline", type

!connect jdbc:hive2://localhost:10000/foodmart

or even better replace "localhost" with the FQDN of the node where HS2 is running. It's assumed that "foodmart" is an existing database in Hive. Otherwise you can use "default", or omit database name altogether (but keep the final "/"). It's also assumed that the cluster is not keberized. You can also used, from the command line

$ beeline -u "jdbc:hive2://localhost:10000/foodmart"

Thanks a lot Predrag! The first command worked perfectly!

Hi @Oriane glad to hear that it worked! If so, can you please consider to upvote and/or accept my answer. That's how it works, you ask questions, and responders are awarded some points by upvotes and accepted answers. You will also get a few points for accepting each answer. It also help us to keep track of unresolved questions. Merci!