Load data infile :error 2068 (hy000)

Hello,

I am trying to import a CSV file using LOAD DATA INFILE with the following code:

LOAD DATA LOCAL INFILE “C:\Users\hi\Desktop\Testfolder\test.csv”
INTO TABLE table2
FIELDS TERMINDATED by ‘,’
LINES TERMINATED by ‘\n’
IGNORE 1 LINES
(sku,name);

table2 is created and test.csv contains two columns (sku and name).

Running on PopSQL I get the following error:

ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘INFILE “C:\Users\hi\Desktop\Testfolder\test.csv” INTO TABLE table2 FIELDS’ at line 3

While running on the MySQL command line I get the following:
ERROR 2068 (HY000): LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.

I have already enabled my local-infile=1

Finally please let me know if there is a better/easier way to load CSV files (maybe in an automated way so that the file reads directly from multiple CSV files every morning).

It appears that the problem was with the secure-file-priv. I have put my file in the upload directory and it worked.

Can you please explain the secure-file-priv and how to turn it off by default?

Thanks

@mod323 i believe to have a similar issue while trying to import the CSV (from Data Science Independent Project #4 – Home Value Trends - https://drive.google.com/file/d/1Ew2rS1O_Mu5dUh59rlVw9IhCy_xrwftk/view ) file using LOAD DATA INFILE with the following code:

LOAD DATA LOCAL INFILE ‘C:\Users\rober\Downloads\home_value_data.csv’
INTO TABLE home_value_data
FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘"’
LINES TERMINATED BY ‘\r\n’
IGNORE 1 LINES (zip_code, city, state, metro, country,date, value);

The error msg is:
Error: syntax error at or near “DATA”
Error Code: 42601

im quite new with SQL, but i though working on the project using popSQL would be more funny.

any help?