Sqoop export job from hive to Mysql job failed


#1

sqoop export \

–connect “jdbc:mysql://cxln2.c.thelab-240901.internal/retail_db”
–username sqoopuser
–password NHkkP876rp
–export-dir /apps/hive/warehouse/retail_db.db/daily_revenue
–table daily_revenue
–update-key order_date

error
20/01/24 12:05:45 INFO mapreduce.Job: The url to track the job: http://cxln2.c.thelab-240901.internal:8088/proxy/application_1579805754719_0313/
20/01/24 12:05:45 INFO mapreduce.Job: Running job: job_1579805754719_0313
20/01/24 12:05:55 INFO mapreduce.Job: Job job_1579805754719_0313 running in uber mode : false
20/01/24 12:05:55 INFO mapreduce.Job: map 0% reduce 0%
20/01/24 12:06:02 INFO mapreduce.Job: map 100% reduce 0%
20/01/24 12:06:03 INFO mapreduce.Job: Job job_1579805754719_0313 failed with state FAILED due to: Task failed task_1579805754719_0313_m_000000
Job failed as tasks failed. failedMaps:1 failedReduces:0
20/01/24 12:06:03 INFO mapreduce.Job: Counters: 13
Job Counters
Failed map tasks=2
Killed map tasks=2
Launched map tasks=4
Other local map tasks=1
Data-local map tasks=3
Total time spent by all maps in occupied slots (ms)=241428
Total time spent by all reduces in occupied slots (ms)=0
Total time spent by all map tasks (ms)=20119
Total vcore-milliseconds taken by all map tasks=20119
Total megabyte-milliseconds taken by all map tasks=30902784
Map-Reduce Framework
CPU time spent (ms)=0
Physical memory (bytes) snapshot=0
Virtual memory (bytes) snapshot=0
20/01/24 12:06:03 WARN mapreduce.Counters: Group FileSystemCounters is deprecated. Use org.apache.hadoop.mapreduce.FileSystemCounter instead
20/01/24 12:06:03 INFO mapreduce.ExportJobBase: Transferred 0 bytes in 21.5063 seconds (0 bytes/sec)
20/01/24 12:06:03 INFO mapreduce.ExportJobBase: Exported 0 records.
20/01/24 12:06:03 ERROR mapreduce.ExportJobBase: Export job failed!
20/01/24 12:06:03 ERROR tool.ExportTool: Error during export: Export job failed!


#3

Hi,
Kindly check your command.
sqoop export --connect jdbc:mysql://10.142.1.2/sqoopex -m 1 --table sales_satyajit --export-dir /apps/hive/warehouse/satyajitdas114a57801.db/sales_test --input-fields-terminated-by ‘,’ --username sqoopuser --password NHkkP876rp

It should work as it worked for me.
Replace username with your username and table name.

All the best.