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).