Save data into mysql from hive hadoop through sqoop?
Question
I have my data store into hive table. i want to transfer hive tables selected data to mysql table using sqoop.
Please guide me how to do this?
Solution
check out the sqoop guide here
OTHER TIPS
You need to use sqoop export, here is the example
sqoop export --connect "jdbc:mysql://quickstart.cloudera:3306/retail_rpt_db" \
--username retail_dba \
--password cloudera \
--table departments \
--export-dir /user/hive/warehouse/retail_ods.db/departments \
--input-fields-terminated-by '|' \
--input-lines-terminated-by '\n' \
--num-mappers 2
sqoop export to export data to mysql from Hadoop.
- --connect JDBC url
- --username mysql username
- --password password for mysql user
- --table mysql table name
- --export-dir valid hadoop directory
- --input-fields-terminated-by column delimiter in Hadoop
- --input-lines-terminated-by row delimiter in Hadoop
- --num-mappers number of mappers to process the data
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow