启动hive后,输入show databases;报错

1、使用命令hive启动后,输入show databases; 显示如下错误

 

 问题解决:因为hive命令只是启动了客户端,所以我们需要先启动hive服务,再使用hive命令启动客户端

# 启动hive服务
./hive --service metastore &

# 启动hive客户端
./hive

 

2、但在输入启动服务器的命令后,又发现会报如下错误

  错误一:MetaException(message:Version information not found in metastore.)

  错误二:MetaException(message:Required table missing : "`DBS`" in Catalog "" Schema "". DataNucleus requires this table to perform its persistence operations


解决方法:修改 conf/hive-site.xml文件,添加如下内容
 <property>
    <name>hive.metastore.schema.verification</name>
    <value>false</value>
  </property>


  <property>
    <name>datanucleus.schema.autoCreateAll</name>
    <value>true</value>
  </property>

 


最后按照先启动hive服务器的命令,再启动hive客户端的命令,即可正常使用hive。




posted @ 2023-01-11 10:23  先娶国王后取经  阅读(1125)  评论(0编辑  收藏  举报