The generic command i.e used to import data from MySql to HDFS is as shown in below image:
![image](https://lh6.googleusercontent.com/p4cs9WP-RFsLunlJZhGTFVmffep2y7EznlkmdiyWfxiQ89mYjh4_ZDoSnSjjE3RCZsLlTVp-fABVdTZMWxyeStTJZYp5uW8kjQsElFgPissQ9lH37SkvwhL9mne9VLLxFWlnXUFn)
Now, to understand import function, let us take an example:
Suppose we have to import the given below table to HDFS.
![image](https://lh4.googleusercontent.com/gjsyh1R6i5bEM0uAZKx_PudaKM8hmYuRLSEonX-GX8E5I2TkLU8i9DadffzNZd2oNF07MZZ6rIuSTR-x9XdV9wjENSdD3uKghqsKPcsQu6gY4AbYdAThXQRFl0A3YgEk8_hOOO7C)
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.