I am trying to connect to hive installed in my machine through Beeline client. when I give the 'beeline' command & connect to Hive, the client is asking for user name & password
!connect jdbc:hive2://localhost:10000/default
I have no idea what is the user name and password I am supposed to give. Do I have to add the credential(user name & password) in some configuration file?
• Loading beeline, the URL and providing your username & password in one command:
Using beeline to hive server where Kerberos Security is enabled
Example
Yes, you can set the username and password in the
hive-site.xml
file inside tgeconf
folder. Default credentials areAPP
/mine
.how to get database username and password in hive
Accessing HIVE via Beeline:
Starting beeline client
Note: The command line option “—incremental=true” is optional, but will extend the amount of time that you can remain idle and not have your connection dropped.
Connecting to hive2 server
Note: You will be prompted for your username & password. USE user name and Password
Setting Your Queue (if any)
Note: You need to set a queue in order to run queries.
Setting Your Database
Note: You should be in a database when executing queries.
Reconnecting an inactive session
Quitting beeline client
Notes:
Basic Beeline Queries
Beeline supports a rich set of SQL query functions.
Getting Information About Data
Simple limited select statements
no username and no password.
Just press enter. It works for me.
Or try this.
You can use blank username and password as @sravan mentioned. This will execute the query as the user that the hiveserver2 process is running as.
However, if you have set the
hive.server2.enable.doAs
property in your hive-site.xml or put it in hiveconf while running hiveserver2 then you can optionally pass a username and password via the prompt. In this case hive will execute the query as the passed username using the given password. The username here is a system username.In some scenarios it's required - say you are running the hiveserver2 process as the user 'hive' but you have an external table defined with HDFS path /user/alex/table1, which is owned by the user 'alex' and no other user has read/write access on this location. In this case running the query as 'hive' - by putting empty username and password - will not work since it will not be able to access the directory and throw a permission denied Exception.