Connect to a hive using Beeline

I am trying to connect to the hive installed on my machine through the Beeline client. when I give the beeline command and connect to Hive, the client asks for a username and password

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

I have no idea what username and password I should give. Should I add credentials (username and password) to some configuration file?

+14
source share
7 answers

no username and password.

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

  Enter username for jdbc:hive2://localhost:10000/default: <press Enter>
  Enter password for jdbc:hive2://localhost:10000/default: <press Enter>

Just hit enter. This works for me.

Or try this one.

!connect jdbc:hive2://localhost:10000/default "" "" ""
+12
source

Access to HIVE through Beeline:

Beeline client launch

beeline --incremental=true

. "-incremental = true" , , , .

hive2

!connect jdbc:hive2://silver-server-
hive.app.google.com:10000/default

. .

beeline> !connect jdbc:hive2:// silver-server-hive.app.google.com:10000/default
scan complete in 3ms
Connecting to jdbc:hive2:// silver-server-hive.app.google.com:10000/default
Enter username for jdbc:hive2:// silver-server-hive.app.google.com:10000/default:suman
Enter password for jdbc:hive2:// silver-server-hive.app.google.com:10000/default: *********

( )

set mapred.job.queue.name=<your queue name>; 

. , .

USE google_map_data;

. .

!reconnect jdbc:hive2:// silver-server-hive.app.google.com:10000/default; 

beeline

!quit

:

  • beeline, URL :

beeline -u jdbc:hive2:// silver-server-hive.app.google.com:10000\ 
-n <yourname> -p <yourpassword> --incremental=true**

Beeline

Beeline SQL-.

SHOW DATABASES;
USE <database>;

SHOW TABLES;
DESC <table>;
DESC FORMATTED <table>;

SELECT * FROM google_map_city limit 25;
+12

beeline , Kerberos Security

 beeline -u "jdbc:hive2://<Server Ip>:<port>/sample;principal=<hive user>/<Server Ip>@<relam>;retries=3"

 beeline -u "jdbc:hive2://10.10.10.10:8071/sample;principal=hive/10.10.10.10@abc.com;retries=3"
+6

, @sravan. , hiveserver2.

, hive.server2.enable.doAs hive-site.xml hiveconf hiveserver2, . . - .

- , hiveserver2 , , HDFS path/user/alex/table1, "alex" / . "hive" - - , , .

+3

, . , . -

beeline -u jdbc:hive2://localhost:10000/default

- putty, - .

EDIT

: beeline, bash_profile.

bash ( kerberos, @Harsimranjit Singh Kler) beeline -u jdbc:hive2://<hostname>:10000/default;principal=hive/<hostname>@<realm>;ssl=true; bash_profile (source .bash_profile) . beeline hive2

+3

, hive-site.xml tge conf. : APP/mine.

+1

• Download beeline, URL and enter your username and password in one command:

**beeline -u jdbc:hive2:// silver-server-hive.app.google.com:10000\ 
-n <yourname> -p <yourpassword> --incremental=true**
-1
source

All Articles