Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive, mail # user - Trouble using mysql metastore


Copy link to this message
-
Re: Trouble using mysql metastore
Bennie Schut 2011-03-02, 15:01
Usually this is caused by not having the mysql jdbc driver on the
classpath (it's not default included in hive).
Just put the mysql jdbc driver in the hive folder under "lib/"

On 03/02/2011 03:15 PM, Ajo Fod wrote:
> I've checked the mysql connection with a separate java file with the
> same string.
>
> Also, I've checked the code works by running it against the original
> derby metastore.
>
> Thanks,
> Ajo.
>
> Some of the variables set:
> javax.jdo.option.ConnectionURL =
> jdbc:mysql://192.168.1.5/metastore?createDatabaseIfNotExist=true
> <http://192.168.1.5/metastore?createDatabaseIfNotExist=true>
> javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
> javax.jdo.option.ConnectionUserName=username
> javax.jdo.option.ConnectionPassword=password
>
> Here is the stack trace: ...
>
> org.apache.hadoop.hive.ql.metadata.HiveException:
> javax.jdo.JDOFatalInternalException: Error creating transactional
> connection factory
> NestedThrowables:
> java.lang.reflect.InvocationTargetException
>         at
> org.apache.hadoop.hive.ql.metadata.Hive.getTablesByPattern(Hive.java:919)
>         at
> org.apache.hadoop.hive.ql.metadata.Hive.getTablesByPattern(Hive.java:904)
>         at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeCreateTable(SemanticAnalyzer.java:7098)
>         at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:6576)
>         at
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:238)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:340)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:773)
>         at
> org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:209)
>         at
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:286)
>         at
> org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:307)
>         at
> org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:314)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:487)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
> Caused by: javax.jdo.JDOFatalInternalException: Error creating
> transactional connection factory
> NestedThrowables:
> java.lang.reflect.InvocationTargetException
>         at
> org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:425)
>         at
> org.datanucleus.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:601)
>         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(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         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:234)