WIN10下解决HIVE 初始化MYSQL表报错:Unknown version specified for initialization

今天本地WINDOWS装HIVE,走到最后一步初始化数据库死活不通过:

D:\hive\hive-rel-release-3.1.3\bin\ext>hive --service schematool -dbType mysql -initSchema --verbose
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/hive/hadoop-3.2.4/share/hadoop/common/lib/slf4j-reload4j-1.7.35.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/hive/hive-rel-release-3.1.3/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Reload4jLoggerFactory]
2023-12-05 22:52:30,336 INFO conf.HiveConf: Found configuration file file:/D:/hive/hive-rel-release-3.1.3/conf/hive-site.xml
2023-12-05 22:52:30,586 INFO tools.HiveSchemaHelper: Metastore connection URL:   jdbc:mysql://localhost/metastore?serverTimezone=GMT%2B8
Metastore connection URL:        jdbc:mysql://localhost/metastore?serverTimezone=GMT%2B8
2023-12-05 22:52:30,587 INFO tools.HiveSchemaHelper: Metastore Connection Driver :       com.mysql.jdbc.Driver
Metastore Connection Driver :    com.mysql.jdbc.Driver
2023-12-05 22:52:30,592 INFO tools.HiveSchemaHelper: Metastore connection User:  hive
Metastore connection User:       hive
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Starting metastore schema initialization to 3.1.0
org.apache.hadoop.hive.metastore.HiveMetaException: Unknown version specified for initialization: 3.1.0
org.apache.hadoop.hive.metastore.HiveMetaException: Unknown version specified for initialization: 3.1.0
        at org.apache.hadoop.hive.metastore.MetaStoreSchemaInfo.generateInitFileName(MetaStoreSchemaInfo.java:137)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:585)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:567)
        at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1517)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
*** schemaTool failed ***

错误提示也是很奇葩的不知所云。

有个StackOverflow的据说是解决了但是在我这儿然并卵:

hadoop - Unknown version specified for initialization: 3.1.0 schemaTool failed - Stack Overflowhttps://stackoverflow.com/questions/64662650/unknown-version-specified-for-initialization-3-1-0-schematool-failed最后使用最土但是最有效的方法,找到SQL脚本:

hive-rel-release-3.1.3\standalone-metastore\src\main\sql\mysql\hive-schema-3.1.0.mysql.sql

执行成功!终于看到熟悉的命令界面了:

折腾了2个小时,最后最简单的方法还是最有效

相关推荐
momo小菜pa22 分钟前
【MySQL 06】表的增删查改
数据库·mysql
Data 3172 小时前
Hive数仓操作(十七)
大数据·数据库·数据仓库·hive·hadoop
程序员大金3 小时前
基于SpringBoot+Vue+MySQL的装修公司管理系统
vue.js·spring boot·mysql
gorgor在码农3 小时前
Mysql 索引底层数据结构和算法
数据结构·数据库·mysql
-seventy-3 小时前
SQL语句 (MySQL)
sql·mysql
一般路过糸.4 小时前
MySQL数据库——索引
数据库·mysql
无敌少年小旋风5 小时前
MySQL 内部优化特性:索引下推
数据库·mysql
翔云1234565 小时前
MVCC(多版本并发控制)
数据库·mysql
静听山水6 小时前
mysql语句执行过程
数据库·mysql
Q_w77427 小时前
一个真实可用的登录界面!
javascript·mysql·php·html5·网站登录