第一种 本地客户端连接
[root@linux01 hive-2.3.1]# bin/hive
第二种:远程连接hiveserver2
先启动hiveserver2,再通过beeline连接
beeline
beeline> !connect jdbc:hive2://linux01:10000
Connecting to jdbc:hive2://linux01:10000
Enter username for jdbc:hive2://linux01:10000: root
Enter password for jdbc:hive2://linux01:10000: root
Connected to: Apache Hive (version 2.3.1)
Driver: Hive JDBC (version 2.3.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://linux01:10000>
或者
beeline -u jdbc:hive2://localhost:10000 -n root