Hive Metastore没有创建MYSQL或Derby Connection

时间:2014-01-30 08:51:23

标签: mysql hadoop hive derby

Hive Metastore没有创建MYSQL或Derby Connection。

对于德比

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 ***

对于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 ***

问题是什么。

我正在运行Hive 0.12.0

4 个答案:

答案 0 :(得分:1)

我认为问题出在您的网址上。修改URL如下。把mysql端口号。

Metastore连接网址:jdbc:mysql://localhost:3306/metastore

答案 1 :(得分:1)

如果您想访问Derby,我怀疑这些应该是:

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

而不是

Metastore connection URL:    jdbc:mysql://localhost/metastore
Metastore Connection Driver :    com.mysql.jdbc.Driver

答案 2 :(得分:1)

对于此特定错误"无法加载驱动程序",您应检查是否已复制mysql连接器或在Hive lib文件夹中有链接。

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

(如果你没有在Java库中拥有它,请下载它)

同样也可以获得Derby的lib。

答案 3 :(得分:0)

错误消息非常广泛。要获得有关根本原因的更多信息,schematool支持-verbose标志:

schematool -dbType derby -initSchema -verbose

这将打印完整的堆栈跟踪,在我的情况下识别丢失的数据库:

  

引起:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:   未知的数据库和