//验证sqoop是否连接到mysql数据库
sqoop list-tables --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root
//导入整表到hdfs
sqoop import --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root --table family --target-dir /guizhou/family/
//根据sql导入到hdfs
sqoop import --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root --query 'select * from family where familyid>66043 and $CONDITIONS' --split-by familyid -m 3 --target-dir /guizhou/family2
//根据sql导入到hive
sqoop import --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root --query 'select * from family where familyid>66043 and $CONDITIONS' --split-by familyid --hive-import -m 5 --target-dir /guizhou/family4 --hive-table family3
//根据sql导入到hbase
sqoop import --connect 'jdbc:mysql://n1/guizhou_test?useUnicode=true&characterEncoding=utf-8' --username root --password root --query 'select * from family where familyid>66043 and $CONDITIONS' --split-by familyid -m 5 --hbase-table family --column-family cf --hbase-row-key "RID"--hbase-create-table