一、利用sqoop在hive中建立一個與mysql中一摸同樣的表
mysql
sqoop create-hive-table --connect jdbc:mysql://192.168.179.10:7001/test --username root --password 123 --hive-database hive --table test6 --hive-table test6
sql
二、利用sqoop將mysql中的數據導入到hive中
oop
sqoop import --connect jdbc:mysql://192.168.179.10:7001/test --username root --password 123 --hive-database hive --table test6 --hive-importinput
三、利用sqoop將hive中的表導入到mysql中(m指定是mr程序個數)table
sqoop export --connect jdbc:mysql://192.168.179.10:7001/test --username root --password 123 --table test6 --export-dir /user/hive/warehouse/test6 --input-fields-terminated-by '\001' -m 2
test