sqoop從hdfs 中匯出資料到mysql

2021-09-08 13:13:31 字數 587 閱讀 3156

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-dir /movie/top_n_city/output/\

--input-fields-terminated-by '\t'

\ --columns="

city,sumprice

"

--input-fields-terminated-by '\t'\  這個是定義檔案使用sm分割的

--m 1 只用乙個mr

--columns 匯出哪些列

表資料hdfs'上的資料

補充:

sqoop安裝之後的配置,配置很簡單,加上上面的資料就可以用了

sqoop2從hdfs中匯入到mysql

資料準備 hive資料庫檔案 例路徑為 user hadoop hive test 在mysql建立與hive中資料庫結構一樣的資料庫。啟動sqoop2服務 sqoop2 server start 登入客戶端 sqoop2 shell 建立資料庫物件 建立hdfs的link物件 建立乙個job作業 ...

資料庫中匯出資料到HDFS

sqoop import m 1 connect jdbc mysql 主機ip 3306 資料庫名 username 使用者名稱 password 使用者密碼 table 表名 columns name,age where age 18 target dir 存在hdfs上的表名 delete t...

從資料庫中匯出資料

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