全部导入
$ bin/sqoop import \ --connect jdbc:mysql://192.168.34.21:3306/company \ --username root \ --password 123456 \ --table staff \ --target-dir /company \ --delete-target-dir \ --fields-terminated-by "\t" \ --num-mappers 1 \ --split-by id导入指定列 –columns
$ bin/sqoop import \ --connect jdbc:mysql://hadoop101:3306/company \ --username root \ --password 123456 \ --table staff \ --columns id,name \ --target-dir /company \ --delete-target-dir \ --fields-terminated-by "\t" \ --num-mappers 1 \ --split-by id提示:columns中如果涉及到多列,用逗号分隔,分隔时不要添加空格
导入指定行 –where
$ bin/sqoop import \ --connect jdbc:mysql://hadoop101:3306/company \ --username root \ --password 123456 \ --table staff \ --where 'id >= 1 an