sqoop从MySQL中导入hive中

命令:bin>>

导入hive:

  ./sqoop import --connect jdbc:mysql://127.0.0.1:3306/test --username root --password root --table info --delete-target-dir --num-mappers 1 --hive-import --hive-database test --hive-table db_hive_info

导入hdfs:
./sqoop import --connect jdbc:mysql://127.0.01:3306/test --table movie --username root --password root --target-dir /csz/movie -m 1


或者:

./sqoop import --connect jdbc:mysql://127.0.01:3306/test --table movie --username root --password root --target-dir /csz/movie -m 1  --fields-terminated-by "\t"

或者:
./sqoop import --connect jdbc:mysql://127.0.01:3306/test  --username root --password root --target-dir /csz/movie/userid -m 1  --fields-terminated-by "\t" --query "select userid from movie where userid>0 and \$CONDITIONS" --split-by userid

你可能感兴趣的:(大数据)