0

I tried to load a dataset to MySQL with the following code that includes my path:

LOAD DATA INFILE '\\Documents\\Anna_Projects\\Ex_Files_Database_Clinic_MySQL\\Exercise_Files\\Datasets\\CAproj_2010-2060.csv'
INTO TABLE pop_proj 
FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES;

But I got an error message 1290 that MySQL server is running with secure-file-priv option. However, when I add LOCAL to LOAD DATA LOCAL INFILE, I got another error message that "no such file or directory". What is the best way for me to fix this? I am a MacBook user.

  • Does this answer your question? [Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement](https://stackoverflow.com/questions/31951468/error-code-1290-the-mysql-server-is-running-with-the-secure-file-priv-option) – P.Salmon Jun 12 '22 at 10:23
  • @P.Salmon thanks for the suggestion, I did try to change the secure-file-priv setting but it did not work in the beginning so I moved the CSV file to my local folder then imported the CSV file from there. And then it worked for me. – Anna Quoc Nguyen Jun 13 '22 at 02:22

1 Answers1

0

I already figured it out by moving the CSV file to my local folder and then importing the file from that folder. It took me a while though because I could not locate where is the local folder since it did not show up in my Finder sidebar so I had to open up System Preferences to find where it is and moved it to the Finder sidebar.