Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

sqoop import and export data from diffrent machine ?

Highlighted

sqoop import and export data from diffrent machine ?

New Contributor

I am working with sqoop, I can import and export data from mysql to hive or hbase with the command:

sqoop import \
--connect "jdbc:mysql://localhost:3306/retail_db" \
--username=retail_dba \
--password=password \
--table departments \
--as-sequencefile \
--target-dir=/user/departments

It work fine for me.

Now I am trying to import and export from diffrent machine (my friend's machine)what I have to do.

Thanks

2 REPLIES 2

Re: sqoop import and export data from diffrent machine ?

You have to use his port number and his location(address) of mysql

--connect jdbc:mysql://address/portnumber

Re: sqoop import and export data from diffrent machine ?

Mentor

@Aymen Rahal

First you have to ensure that mysql host is reachable from your host you are operating the sqoop command

  • update /etc/hosts entry with IP/FQDN/Alias of the remote host(friends Machine)
  • No firewall should be blocking the port e.g 3306 for MySQL.
  • You should have the username/password for the remote database.
  • Run the sqoop import command from your machine.

HTH