Reply
New Contributor
Posts: 6
Registered: ‎03-04-2019

Sqoop giving error: "Could not load db driver class: oracle.jdbc.OracleDriver"

[ Edited ]

I have completed the installation of CDH 5.16.1 on Ubuntu 16.04 LTS with OpenJDK 8. I am now in the process of testing the different components to ensure each works as predicted.

 

In my attempt to test Sqoop using the Cloudera Hadoop Tutorial, I ran the following command: 

 

sqoop import-all-tables \
    -m {{cluster_data.worker_node_hostname.length}} \
    --connect jdbc:mysql://{{cluster_data.manager_node_hostname}}:3306/retail_db \
    --username=retail_dba \
    --password=cloudera \
    --compression-codec=snappy \
    --as-parquetfile \
    --warehouse-dir=/user/hive/warehouse \
    --hive-import

 but received the following error:

 

Could not load db driver class: com.mysql.jdbc.Driver

 

In my search for a solution, I downloaded and placed the mysql conector in the following folders according to the advice given:

 

/var/lib/sqoop

 

/opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p0.3/lib/sqoop

 

I am still getting the error above. Please help.

Contributor
Posts: 34
Registered: ‎03-07-2017

Re: Sqoop giving error: "Could not load db driver class: oracle.jdbc.OracleDriver"

[ Edited ]

Im assuming you also changed ownership of the driver to sqoop correct, as well as set permissions of /var/lib/sqoop folder to 755. Can you confirm path of sqoop home?