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

相关推荐
无级程序员1 小时前
hive2服务启动报错:/tmp/hive on HDFS should be writable(不是chmod 777能解决的)
hive·hadoop·hdfs
Edingbrugh.南空1 小时前
Flink MySQL CDC 环境配置与验证
mysql·adb·flink
BD_Marathon2 小时前
Ubuntu:Mysql服务器
服务器·mysql·ubuntu
程序猿小D3 小时前
[附源码+数据库+毕业论文]基于Spring+MyBatis+MySQL+Maven+jsp实现的电影小说网站管理系统,推荐!
java·数据库·mysql·spring·毕业设计·ssm框架·电影小说网站
羊小猪~~3 小时前
数据库学习笔记(十七)--触发器的使用
数据库·人工智能·后端·sql·深度学习·mysql·考研
rui锐rui4 小时前
大数据学习2:HIve
大数据·hive·学习
叁沐4 小时前
MySQL 05 深入浅出索引(下)
mysql
陈卓4104 小时前
MySQL-主从复制&分库分表
android·mysql·adb
你都会上树?5 小时前
MySQL MVCC 详解
数据库·mysql
长征coder6 小时前
AWS MySQL 读写分离配置指南
mysql·云计算·aws