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

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


+
Ajo Fod 2011-03-02, 14:15
+
Bennie Schut 2011-03-02, 15:01
+
Ajo Fod 2011-03-02, 18:14
Copy link to this message
-
Re: Trouble using mysql metastore
Viral Bajaria 2011-03-02, 19:42
This definitely looks like a CLASSPATH error.

Where did you get the mysql.jar from ? Can you open it up and make sure that
it includes the com.mysql.jdbc.Driver namespace ?

I am guessing the mysql.jar is not the one that you need. you can download a
new one from the mysql website.

To be clear, I don't even have a mysql jar in my /lib folder under hive. I
only have it under my hadoop /lib folder and the name of the file
is mysql-connector-java-5.0.8-bin.jar

-Viral

On Wed, Mar 2, 2011 at 10:14 AM, Ajo Fod <[EMAIL PROTECTED]> wrote:

> Hi Bennie,
>
> Thanks for the response !
>
> I had CLASSPATH set to include
> /usr/share/java/mysql.jar
> ... in addition, I just copied the mysql.jar to the lib directory of hive.
>
> I still get the same bug.
>
> Any other ideas?
>
> Thanks,
> -Ajo
>
>
>
>
> On Wed, Mar 2, 2011 at 7:01 AM, Bennie Schut <[EMAIL PROTECTED]> wrote:
>
>>  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
>> 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)