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个小时,最后最简单的方法还是最有效

相关推荐
菲兹园长41 分钟前
表的设计(MYSQL)
数据库·mysql
huaqianzkh43 分钟前
了解Hadoop:大数据处理的核心框架
大数据·hadoop·分布式
Java Fans1 小时前
MySQL数据库常用命令大全(完整版——表格形式)
数据库·mysql
Kika写代码1 小时前
【Hadoop】【hdfs】【大数据技术基础】实验三 HDFS 基础编程实验
大数据·hadoop·hdfs
白萝卜弟弟1 小时前
【MySQL】MySQL函数之JSON_EXTRACT
数据库·mysql·json
gjh12081 小时前
MySQL常见面试题
数据库·mysql
我的K84091 小时前
Flink整合Hive、Mysql、Hbase、Kafka
hive·mysql·flink
little_kid_pea3 小时前
MySQL Workbench导入数据比mysql命令行慢
数据库·mysql
苹果醋33 小时前
C语言 strlen 函数 - C语言零基础入门教程
java·运维·spring boot·mysql·nginx
爪哇学长3 小时前
解锁数据世界:从基础到精通的数据库探索之旅
数据库·mysql·oracle