Hive的JDBC連接


首相要安裝好hive

1.首先修改配置文件文件為hive 路徑下的  conf/hive-sit.xml

將內容增加

<property>
  <name>hive.server2.thrift.port</name>
  <value>10000</value>
  <description>Port number of HiveServer2 Thrift interface.
  Can be overridden by setting $HIVE_SERVER2_THRIFT_PORT</description>
</property>

<property>
  <name>hive.server2.thrift.bind.host</name>
  <value>0.0.0.0</value>
  <description>Bind host on which to run the HiveServer2 Thrift interface.
  Can be overridden by setting $HIVE_SERVER2_THRIFT_BIND_HOST</description>
</property>

這個是hiveserver2需要的端口等內容

2.進入hive目錄執行

 

 

如果沒有日志的話可能什么都不輸出

然后打開新的終端輸入

 

 

3.然后輸入連接信息

執行命令

  !connect jdbc:hive2://127.0.0.1:10000

然后輸入之前設置的用戶名密碼(我的是mysql的用戶名密碼)

然后回車即連接成功。

可以輸入sql進行測試

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM