The generic command i.e used to import data from MySql to HDFS is as shown in below image:
Now, to understand import function, let us take an example:
Suppose we have to import the given below table to HDFS.
So the command for importing this table to HDFS will be:
sqoop import --connect jdbc:mysql://sqoopdb.edu.cloudlab.com/userdb --username labuser --password edureka --table emp –m 1 --target-dir ‘/user/edureka_249489/sqoop_sql/’;
I hope this will give you some idea about how to import data from MySql to HDFS.