将HDFS上的数据导出到MySQL中
在MySQL中建表
create table orders(orderid int primary key, orderdate varchar(10), productid int, num int);
导出到MySQL中
hdfs中准备数据
hadoop fs -chmod 777 /orders
/orders/order.txt
1,202406,12,30000
2,202406,13,35000
3,202407,14,33000
4,202408,15,31000
sqoop export --connect jdbc:mysql://m1:3306/test?useSSL=false --username root --password Fuhong119@ --export-dir '/orders/order.txt' --table orders -m 1 --fields-terminated-by ','
最后显示Exported 4 records记录成功
标签:HDFS,--,Sqoop,导出,int,export,MySQL,orders From: https://blog.csdn.net/sadfasdfsafadsa/article/details/141784100