Hive Metastore is not creating MYSQL or Derby Conn

2019-06-02 08:25发布

Hive Metastore is not creating MYSQL or Derby Connection.

For Derby

schematool -dbType derby -initSchema
Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   hive

schematool -dbType derby -info
Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   hive
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
*** schemaTool failed ***

For mysql

schematool -dbType mysql -initSchema
Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   hive
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
*** schemaTool failed ***

schematool -dbType mysql -info
Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   hive
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
*** schemaTool failed ***

What is the issue .

I am running Hive 0.12.0

4条回答
我只想做你的唯一
2楼-- · 2019-06-02 09:02

The error message is very broad. To get more information on the root cause, schematool supports the -verbose flag:

schematool -dbType derby -initSchema -verbose

This will print the full stacktrace, which in my case indentified the missing database:

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'metastore'

查看更多
该账号已被封号
3楼-- · 2019-06-02 09:04

If you want to access Derby, I suspect these should be something like:

Metastore connection URL:    jdbc:derby://localhost:1527/metastore
Metastore Connection Driver :    org.apache.derby.jdbc.ClientDriver

instead of

Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver
查看更多
淡お忘
4楼-- · 2019-06-02 09:10

For this specific error "Failed to load driver", you should check if you have the mysql connector copied or has a link in Hive lib folder.

ln -s /usr/share/java/mysql-connector-java.jar $HIVE_HOME/lib/mysql-connector-java.jar

(Download it if you don't have it within the Java libs)

Similarly get the lib for Derby too.

查看更多
beautiful°
5楼-- · 2019-06-02 09:11

I think the problem is with your URL. Modify the URL as follows. Put the mysql port no.

Metastore connection URL: jdbc:mysql://localhost:3306/metastore

查看更多
登录 后发表回答