Sqoop ERROR 1290 HY000 The MySQL server is running with the --secure-file-priv option

0 votes

I"m trying to load data to mysql from local using the below command

LOAD DATA INFILE "mnt/home/edureka_519340/Basavaraju/Sqoop_Files.county_facts.csv" INTO TABLE county_data_Basavaraju
FIELDS TERMINATED BY "," ENCLOSED BY """
LINES TERMINATED BY "\r\n"
IGNORE 1 LINES;

But getting the following error

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement.

Please suggest how to load the mentioned csv file data in local path to the mysql table.

Jul 10, 2019 in Big Data Hadoop by Adi
2,477 views

1 answer to this question.

0 votes

If your dataset is in the FTP then you have to execute the below command to load it in the table,

Syntax: 

load data local infile '<filepath/filename>' into table <table_name> fields terminated by ',' enclosed by '"'  lines terminated by '\n' ignore 1 rows;

So, your command should look like below,

LOAD DATA LOCAL INFILE 'Basavaraju/Sqoop_Files/county_facts.csv' INTO TABLE county_data_Basavaraju
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES; 

If you notice, I have removed the complete path and just mentioned the directory name and the filename. This is because the load data local infile command searches for the file in the local file system only. 

answered Jul 10, 2019 by Kunal

Related Questions In Big Data Hadoop

0 votes
1 answer

ERROR: org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet!

Hi@akhtar, This error occurs if the hbase server ...READ MORE

answered Mar 30, 2020 in Big Data Hadoop by MD
• 95,460 points
5,511 views
0 votes
1 answer

The file exists before processing with hadoop command

Took session and it got resolved. READ MORE

answered Dec 18, 2017 in Big Data Hadoop by Sudhir
• 1,570 points
1,059 views
0 votes
1 answer
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,077 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,574 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
109,071 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,642 views
0 votes
11 answers
0 votes
1 answer

What is the command to count number of lines in a file in hdfs?

hadoop fs -cat /example2/doc1 | wc -l READ MORE

answered Nov 22, 2018 in Big Data Hadoop by Omkar
• 69,220 points
4,074 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP