I’m trying to import the data from the file, “data.csv” to my MySQL database.
LOAD DATA INFILE './data.csv' IGNORE INTO TABLE puzzles FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
But I receive this error,
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
I looked through some solutions on how to resolve this issue such as setting the secure-file-priv to “” but I cant seem to make it work, I also can’t access the directory /var/lib/mysql-files/
SOLVED: Adding LOCAL
to the command allows it to work: LOAD DATA LOCAL INFILE './data.csv' IGNORE INTO TABLE puzzles FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';