0
LOAD DATA INFILE 'returns_inprogress_06-Feb-2016-11-35.csv'
IGNORE INTO TABLE fkreturn
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY '\n'
(`FSN`,`Product`,`Order Id`,`ORDER ITEM ID`,`SKU Code`,`Return ID`,`Return Created On`,`Return Action`,`Return Type`,`Is FA`,`New Order Item Id`,`Sub Reason`,`Comments`,`Shipment Status`,`Tracking Id`,`Good Quantity`,`Bad Quantity`,`Total Price`,`Quantity`);

when executed it gives a error "#1290 - The MySQL server is running with the --secure-file-priv option" so it cannot execute this statement. I am using windows wamp, CSV file is in www folder. All I want is to ignore the duplicates of primary key (Return ID) and upload others.Should this field be marked as unique also. Or any other easy way to upload csv to table ignoring duplicates

Kanted
  • 169
  • 1
  • 12
  • http://stackoverflow.com/questions/32737478/mysql-how-to-tackle-secure-file-priv/32737616 You need to move the file to a place it can be read. – Pete Feb 06 '16 at 08:27
  • what should be the path. /www/returns_inprogress_06-Feb-2016-11-35.csv is it? – Kanted Feb 06 '16 at 08:30
  • On a unix system, I think I've had to put it into the MySQL dir before. That's a bit extreme, but it worked. – Pete Feb 06 '16 at 19:03
  • found that I need to give complete path c:/wamp/project_folder/filename – Kanted Feb 10 '16 at 10:38
  • Well done. Sorry I didn't think of that. – Pete Feb 10 '16 at 19:33

0 Answers0