Solved

getting jdbc to work on a mac os

Posted on 2011-03-03
3
1,028 Views
Last Modified: 2012-05-11
Hi...

I used sudo port install mysql-connector-java to install a mysql connectory for jdbc.

Whe I try and execute this command...

sqoop import --connect jdbc:mysql://ubuntu@xxxxx.com/testdb1 --table test -m 1

I get this error

11/03/04 16:47:45 INFO tool.CodeGenTool: Beginning code generation
11/03/04 16:47:45 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
      at com.cloudera.sqoop.manager.SqlManager.makeConnection(SqlManager.java:597)
      at com.cloudera.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:51)
      at com.cloudera.sqoop.manager.MySQLManager.execute(MySQLManager.java:201)
      at com.cloudera.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:177)
      at com.cloudera.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:161)
      at com.cloudera.sqoop.orm.ClassWriter.generate(ClassWriter.java:908)
      at com.cloudera.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:82)
      at com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:337)
      at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:423)
      at com.cloudera.sqoop.Sqoop.run(Sqoop.java:144)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
      at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:180)
      at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:218)
      at com.cloudera.sqoop.Sqoop.main(Sqoop.java:228)

How to I fix so I can use jdbc

I also have the jar fle from the mysql website.
0
Comment
Question by:dmontgom
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 35033965
you need to add the (installed) jars to your classpath
0
 
LVL 92

Expert Comment

by:objects
ID: 35033970
you can achieve that by copying the jat to $SQOOP_HOME/lib
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35034748
Copy the mysql driver jar to the lib/ext directory of your active java runtime
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question