AnsweredAssumed Answered

Unable to connect Hive with mysql

Question asked by rahul_mapr on Feb 14, 2018
Latest reply on Feb 16, 2018 by arjunkr

I have installed hivemetastore anf hive base packages (version 1.2) on MAPR 5.2.0.

I am trying to use mysql as my metastore database. However when I try o initialize beeline using schematool

I get below error:

 

# /opt/mapr/hive/hive-1.2/bin/schematool -initSchema -dbType mysql -userName hiveuser -password hivepassword
Metastore connection URL:        jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:       hiveuser
Starting metastore schema initialization to 1.2.0
Initialization script hive-schema-1.2.0.mysql.sql
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
        at jline.TerminalFactory.create(TerminalFactory.java:101)
        at jline.TerminalFactory.get(TerminalFactory.java:158)
        at org.apache.hive.beeline.BeeLineOpts.<init>(BeeLineOpts.java:76)
        at org.apache.hive.beeline.BeeLine.<init>(BeeLine.java:118)
        at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:346)
        at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:326)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:266)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:243)
        at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:473)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
        at org.apache.hive.beeline.BeeLineOpts.<init>(BeeLineOpts.java:119)
        at org.apache.hive.beeline.BeeLine.<init>(BeeLine.java:118)
        at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:346)
        at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:326)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:266)
        at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:243)
        at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:473)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
As suggested on community I used below option but didn't help

export HADOOP_USER_CLASSPATH_FIRST=true
I am able to connect to mysql database using hiveuser.

Outcomes