資料庫中匯出資料到HDFS

2021-12-30 06:42:50 字數 472 閱讀 4647

sqoop import -m 1

--connect jdbc:mysql://主機ip:3306/資料庫名

--username 使用者名稱

--password 使用者密碼

--table 表名

--columns "name,age"

--where "age>18"

--target-dir 存在hdfs上的表名

--delete-target-dir

-m 說明使用多少個map進行資料遷移,如果表比較大的話,建議使用多個map,預設的map為4個 –table 是要匯入hdfs中的表 –columns 選擇要匯入的列,這裡選擇把name與age兩列匯入的hdfs中。 –where 對資料進行過濾,只有滿足條件的才儲存到hdfs中。 –target-dri 指定儲存在hdfs上的表名 –delete-target-dir 表示如果hdfs表存在,則把他刪除。

sqoop從hdfs 中匯出資料到mysql

bin sqoop export connect jdbc mysql mini1 3306 study?useunicode true characterencoding utf 8 username root password root table top n city m 1 export d...

從資料庫中匯出資料

首先開啟xp cmdshell許可權 exec sp configure show advanced options 1 reconfigure exec sp configure xp cmdshell 1 reconfigure 1,匯出資料到txt exec master.xp cmdshel...

從資料庫中匯出資料庫文件

select case when a.colorder 1 then d.name else end n 表名 a.colorder n 字段序號 a.name n 欄位名 case when columnproperty a.id,a.name,isidentity 1 then else end...