Reply
Contributor
Posts: 59
Registered: ‎11-24-2017

Why Sqoop import from MySQL fails when I specify the driver class explicitly?

 

When importing data from MySQL through Sqoop I found that it fails if I specify the driver class, like so:

 

sqoop import \
--driver com.mysql.jdbc.Driver \
--connect jdbc:mysql://localhost/db \
--username usr \
--password pwd \
--table table \
--split-by field \
--target-dir /path/to/hdfsdir

While it works without the driver:

 

sqoop import \
--connect jdbc:mysql://localhost/db \
--username usr \
--password pwd \
--table table \
--split-by field \
--target-dir /path/to/hdfsdir

 

In Oozie it is the opposite, it fails if I don't specify the driver class.

Can anyone explain why it works this way?

 

Announcements