1.MySQL ==》HDFS:
sqoop import –connect jdbc:mysql://hd03/test –username root –password 123456–table stu –target-dir /user/root/stu
2.向已经存在HDFS目录追加数据
sqoop import –connect jdbc:mysql://hd03/test –username root –password test –table st –append –target-dir /user/test/sqoop
3.mysql ==> Hbase
sqoop import –connect jdbc:mysql://hd03/test –username root –password test –table mt –hbase-create-table –hbase-table mt –column-family cf –hbase-row-key year,month,day,sta_id
4.将关系型数据的表结构复制到hive中
sqoop create-hive-table –connect jdbc:mysql://localhost:3306/test –table username –username root –password 123456 –hive-table test
5.MySQL ==》hive:
sqoop import –connect jdbc:mysql://localhost:3306/test –username root –password mysql-password –table t1 –hive-import
6.hive ==> mysql:
sqoop export –connect jdbc:mysql://localhost:3306/test –username root –password root –table testa –export-dir /user/hive/warehouse/testa –input-fields-terminated-by ‘\001’
7.hive ==> hbase
8.hbase ==> mysql
没有这样的命令,可以先把hbase里数据导入到HDFS,再将数据导出到MySQL