Hive2.x版本创建表报错:Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

错误信息:

 SemanticException org.apache.hadoop.hive.ql.metadata.HiveException:     
java.lang.RuntimeException:
 Unable to instantiate 
org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

创建表语句:

create table student(
id int,
name string,
sex string,
age int
)
row format delimited fields terminated by ',';

错误截图:

解决方案:

1、将mysql的驱动包复制到hive安装目录的lib目录下

2、由于hive 2.X版本后在启动hive前要先初始化元数据库 执行以下命令进行初始化

schematool -dbType mysql -initSchema

猜你喜欢

转载自blog.csdn.net/zjh_746140129/article/details/82812856