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

相关推荐
Yvonne9781 分钟前
Hadoop初体验
大数据·hadoop
vip1024p7 分钟前
第二篇:MySQL安装与配置(基于小皮面板(phpstudy))
数据库·mysql·adb
南宫文凯2 小时前
Hadoop-HA(高可用)机制
大数据·hadoop·分布式·hadoop-ha
杰九4 小时前
【环境配置】maven,mysql,node.js,vue的快速配置与上手
java·vue.js·spring boot·mysql·node.js·maven
致奋斗的我们5 小时前
HAProxy介绍与编译安装
linux·汇编·数据库·mysql·青少年编程·haproxy·openeurler
Mr-Apple6 小时前
MySQL的Union和OR查询
android·数据库·mysql
先睡6 小时前
Spring MVC配置文件
数据仓库·hive·hadoop
hxung7 小时前
MySQL面试学习
学习·mysql·面试
莳花微语7 小时前
使用MyCAT实现分布式MySQL双主架构
分布式·mysql·架构
he258197 小时前
centOS 7.9 安装JDK MYSQL
java·mysql·centos