For Sqoop with MySQL, It requires MySQL connector jar in Sqoop binary location.
Sqoop binary location: usr/hdp/current/sqoop
Sqoop Commands:
#List Databases
>
sqoop
list-databases
--connect
jdbc:mysql://<mysql-URL>:<port> --username <USERNAME>
--password <PASSWORD>
#List Table from database
>
sqoop
list-tables
--connect jdbc:mysql://<mysql-URL>:<port>/<DBName>
--username <USERNAME> --password <PASSWORD>
#Evaluate sql query
For evaluate sql query
>
sqoop
eval
--connect jdbc:mysql://<mysql-URL>:<port>/<DBName>
--username <USERNAME> --password <PASSWORD>
--query
“<SQL
QUERY>”
Comments
Post a Comment