I use hive-0.6 an use mysql as metasore, but hive don't connection the
mysql.

2010-08-30 13:28:24,982 ERROR [main] util.Log4JLogger(125): Failed
initialising database.
Invalid URL: jdbc:mysql://127.0.0.1:3306/hive6?createDatabaseIfNotExist=true
org.datanucleus.exceptions.NucleusDataStoreException: Invalid URL:
jdbc:mysql://127.0.0.1:3306/hive6?createDatabaseIfNotExist=true
    at
org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:536)
    at
org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:290)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at
org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:588)
    at
org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:300)
    at
org.datanucleus.ObjectManagerFactoryImpl.initialiseStoreManager(ObjectManagerFactoryImpl.java:161)
    at
org.datanucleus.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:583)
    at
org.datanucleus.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:286)
    at
org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:182)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at javax.jdo.JDOHelper$16.run(JDOHelper.java:1958)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.jdo.JDOHelper.invoke(JDOHelper.java:1953)
    at
javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159)
    at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:803)
    at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
    at
org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:191)
    at
org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:208)
    at
org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:153)
    at
org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:128)
    at
org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:54)
    at
org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:83)
    at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:276)
    at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.executeWithRetry(HiveMetaStore.java:228)
    at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:374)
    at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:166)
    at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:125)
    at
org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.<init>(HiveServer.java:79)
    at
org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:85)
    at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:110)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at my.examples.multithreadquery.SimpleSql.main(SimpleSql.java:21)
Caused by: java.sql.SQLException: Invalid URL: jdbc:mysql://
127.0.0.1:3306/hive6?createDatabaseIfNotExist=true
    at
org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:76)
    at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:110)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at
org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:75)
    at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
    at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1148)
    at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
    at
org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:521)
    ... 38 more



I find hive0.6 to connection mysql with
org.apache.hadoop.hive.jdbc.HiveDriver.  I think that is wrong, it should
use com.mysql.jdbc.Driver to connection mysql.
Below is my conifguration:

<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://127.0.0.1:3306/hive6?createDatabaseIfNotExist=true
</value>
  <description>JDBC connect string for a JDBC metastore</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>


<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>root</value>
  <description>username to use against metastore database</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>root</value>
  <description>password to use against metastore database</description>
</property>

Reply via email to