sqoop导出到mysql的连接问题

export_method(){
V_DATE=`date --date="-1 day" +%Y%m%d`
V_TABLE=app_member_statistics_di
user=root
D_PASSWORD='Trtjk@2019'
T_TABLE=app_member_statistics_di
CONNECT='jdbc:mysql://10.8.157.179:3306/dp_statistics?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8'
T_DIR=/smartguide/app/${V_TABLE}/pt*/        
T_column=refund_order_amount,success_order_amount,total_amount,gift_refund_amt,recharge_amount,gift_recharge_amount,balance_consume_amount,gift_consume_amount,balance_refund_amount,balance_refund_number,balance_consume_number,success_order_number,refund_order_number,consume_tab,member_phone,member_id,member_name,member_gender,member_age,member_level,store,create_time,data_time

sqoop export \
--connect $CONNECT \
--username $user \
--password $D_PASSWORD \
--table $T_TABLE \
--export-dir $T_DIR \
--columns $T_column \
--input-fields-terminated-by '\001' \
--input-lines-terminated-by '\n' \
--input-null-string "\\\\N" \
--input-null-non-string "\\\\N"
}
export_method

老是报错链接失败
上边的jdbc没有加单引号 ’ ',导致脚本未识别jdbc报错

你可能感兴趣的:(sqoop,mysql)