7 steps to ‘Sqoop’ data from mySQL to Hadoop

“Assuming you have everything setup with hdfs and sqoop”

  1. Create a test database and a test table init as root user.
student table in testDb with sample records inserted in it. (Azim is my name and i dont know who archana is ! :P)

2. Insert some sample records in to the table

3. quit mysql console and run sqoop help. you should see something like this.

4. Run sqoop import command as shown below

sqoop import command

5. The Sqoop command self explanatory you — connect mysql with username and password supplying the table name, target directory in hdfs and tell sqoop that you are using mysql.jdbc.Driver

6. If the command runs successfully you should see something like “Retrieved # records”

7. Verify if the data has been imported in to HDFS.

data imported is stored as part file.

Hence Sqoooooooooooooooooooooooooooooooooooooped !

Learner, thinker and Doer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store