beeline连接hive的两种方式
前提先要启动hiveserver2,不启动怎么连接呢.hive --service hiveserver2 &方式1先登录beeline,进入beeline的命令行环境,然后连接[root@mypc01 conf]# beelinebeeline> !connect jdbc:hive2://192.168.xx.101:10000Connecting to jdbc:hive2:/
·
前提先要启动hiveserver2
,不启动怎么连接呢.
hive --service hiveserver2 &
方式1
先登录beeline
,进入beeline
的命令行环境,然后连接
[root@mypc01 conf]# beeline
beeline> !connect jdbc:hive2://192.168.xx.101:10000
Connecting to jdbc:hive2://192.168.xx.101:10000
Enter username for jdbc:hive2://192.168.xx.101:10000: root
Enter password for jdbc:hive2://192.168.xx.101:10000: ******
Connected to: Apache Hive (version 1.1.0-cdh5.13.2)
Driver: Hive JDBC (version 1.1.0-cdh5.13.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://192.168.xx.101:10000> show databases;
INFO : Compiling command(queryId=root_20210103143131_e7b2263c-06d3-4824-b602-c46f599f7978): show databases;
+----------------+--+
| database_name |
+----------------+--+
| default |
+----------------+--+
方式二
一步到位
beeline -u jdbc:hive2://192.168.xx.101:10000 -n root
总结
- 首先要启动
hiveserver2
- 用
beeline
连接hive
有两种方式,第二种简单些
更多推荐
已为社区贡献18条内容
所有评论(0)