Beeline connection string syntax reference

This reference provides syntax examples for Beeline connection strings, covering various authentication methods such as Kerberos, LDAP, SSL, Knox, and non-secured connections. Use these examples to configure Beeline for secure and non-secure Hive access.

Connection Type Beeline Command Comments
Kerberos
beeline -u "jdbc:hive2://<host>:<port>/<db>;principal=<[***HIVE_PRINCIPAL***]>"
N/A
LDAP
beeline -u "jdbc:hive2://<host>:<port>/<db>;AuthMech=3" -n <[***USERNAME***] -p <[***PASSWORD***]"
To configure Beeline for LDAP authentication using a username alone, you need to add thehive.server2.authentication.ldap.userDNPattern property to hive-site.xml and remove the hive.server2.authentication.ldap.binddn and hive.server2.authentication.ldap.bindpw configurations.
SSL
beeline -u "jdbc:hive2://<host>:<port>/<db>;ssl=true;sslTrustStore=<truststore_path>;trustStorePassword=<[***PASSWORD***]>"
N/A
Knox
beeline -u "jdbc:hive2://<knox_host>:<port>/<knox_gateway>;transportMode=http;httpPath=<knox_path>"
N/A
Non-Secured
beeline -u "jdbc:hive2://<host>:<port>/<db>" -n <[***USERNAME***]> -p <[***PASSWORD***]>
N/A
SSL + Kerberos
beeline -u "jdbc:hive2://<host>:<port>/<db>;ssl=true;principal=<[***HIVE_PRINCIPAL***]>;sslTrustStore=<truststore_path>;trustStorePassword=<[***PASSWORD***]>"
N/A
SSL + Kerberos + HTTP Mode
beeline -u "jdbc:hive2://<host>:<port>/<db>;transportMode=http;httpPath=<hive_path>;principal=<hive_principal>;ssl=true;sslTrustStore=<truststore_path>;trustStorePassword=<[***PASSWORD***]>"
N/A