【大数据报错】hive3初始化数据库报错

hive3初始化数据库报错

场景:
hive版本:3.1.1
Hadoop版本:HA3.1.1
系统:CentOS 7.6


hive03.1.1初始化MySQL远程数据库报错:
$ schematool -dbType mysql -initSchema
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hive/apache-hive-3.1.1/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL:        jdbc:mysql://192.168.1.18:3306/hive
Metastore Connection Driver :    com.mysql.cj.jdbc.Driver
Metastore connection User:       root
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
Underlying cause: java.lang.ClassNotFoundException : com.mysql.cj.jdbc.Driver
Use --verbose for detailed stacktrace.
*** schemaTool failed ***

解决:
修改配置文件中的驱动方式
$ vi hive-site.xml
   
        javax.jdo.option.ConnectionDriverName
        com.mysql.cj.jdbc.Driver
   

修改为
   
        javax.jdo.option.ConnectionDriverName
        com.mysql.jdbc.Driver
   

重新初始化Hive,搞定!!!

你可能感兴趣的:(大数据报错)