Sqoop Could not load mysql driver exception

0 votes

I Installed Sqoop in my local machine. Following are the config information.

Bash.bashrc:

export HADOOP_HOME=/home/hduser/hadoop
export HBASE_HOME=/home/hduser/hbase
export HIVE_HOME=/home/hduser/hive
export HCAT_HOME=/home/hduser/hive/hcatalog
export SQOOP_HOME=/home/hduser/sqoop

export PATH=$PATH:$HIVE_HOME/bin
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HBASE_HOME/bin
export PATH=$PATH:$SQOOP_HOME/bin
export PATH=$PATH:$HCAT_HOME/bin

Hadoop:

Version: Hadoop 1.0.3

Hive:

Version: hive 0.11.0 

Mysql Connector driver

version: mysql-connector-java-5.1.29

"The driver is copied to the lib folder of sqoop"

Sqoop :

version: sqoop 1.4.4

After making all the installation I create a table in mysql named practice_1, But when I run the load command to load data from mysql to hdfs the command throws an exception:

ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not     load db driver class: com.mysql.jdbc.Driver

Oct 8, 2018 in Big Data Hadoop by Neha
• 6,300 points
3,297 views

2 answers to this question.

0 votes

You need database driver in 'SQOOP' classpath check this It has wonderful explanation about the 'SQOOP'

SQOOP has other options like

Ex: --driver com.microsoft.jdbc.sqlserver.SQLServerDriver -libjars=".*jar"

from here

You can use Sqoop with any other JDBC-compliant database. First, download the appropriate JDBC driver for the type of database you want to import, and install the .jar file in the $SQOOP_HOME/lib directory on your client machine. (This will be /usr/lib/sqoop/lib if you installed from an RPM or Debian package.) Each driver .jar file also has a specific driver class which defines the entry-point to the driver. For example, MySQL's Connector/J library has a driver class of com.mysql.jdbc.Driver. Refer to your database vendor-specific documentation to determine the main driver class. This class must be provided as an argument to Sqoop with --driver

answered Oct 8, 2018 by Frankie
• 9,830 points
0 votes

I add mysql driver for sqoop and it running :

$ sudo cp mysql-connector-java-version/mysql-connector-java-version-bin.jar /var/lib/sqoop/

Reference: https://docs.cloudera.com/documentation/enterprise/5-4-x/topics/cdh_ig_jdbc_driver_install.html 

answered Mar 1, 2020 by Manh Quang
• 180 points

Related Questions In Big Data Hadoop

0 votes
3 answers
0 votes
1 answer

Sqoop could not load db driver class

Hello, Have you tried to put the both ...READ MORE

answered Dec 13, 2019 in Big Data Hadoop by Alexandru
• 510 points
2,669 views
0 votes
1 answer

Could not find the Sqoop directory in HDP 2.2

You can find the Sqoop lib directory ...READ MORE

answered May 4, 2018 in Big Data Hadoop by Shubham
• 13,490 points
1,282 views
0 votes
1 answer

Hadoop Mapreduce: Error: Could not find or load main class com.sun.tools.javac.Main

You have to add HADOOP_CLASSPATH environment parameter: expor ...READ MORE

answered Oct 30, 2018 in Big Data Hadoop by Omkar
• 69,210 points
3,208 views
0 votes
1 answer

Sqoop transfer file from MySql to HBase

Sqoop doesn’t permit you to import, all ...READ MORE

answered Feb 12, 2019 in Big Data Hadoop by Omkar
• 69,210 points
3,028 views
0 votes
13 answers

What is the difference between Hadoop/HDFS & HBase?

HDFS is a distributed file system whereas ...READ MORE

answered Apr 26, 2019 in Big Data Hadoop by Arihar
• 160 points
32,170 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Will hadoop(sqoop) load oracle faster than SQL loader?

down vote Had a similar task of exporting ...READ MORE

answered Sep 4, 2018 in Big Data Hadoop by Frankie
• 9,830 points
1,543 views
+1 vote
1 answer

What is the process to perform an incremental data load in Sqoop?

The process to perform incremental data load ...READ MORE

answered Dec 17, 2018 in Big Data Hadoop by Frankie
• 9,830 points
5,015 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP