0

For the past 2 days, I have been trying to load data from a CSV file into a mySQL database. At first, I encountered the secure file priv error, which didn't go away when I changed my file location, or when I commented out the relevant line in "my.ini". When I eventually resolved that by changing its value to an empty string, I discovered that I still couldn't load the file as I was getting OS errno2 no such file or directory.

LOAD DATA INFILE "C:/Users/ehize/Downloads/not414.csv" 
INTO TABLE birthrate 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;

I don't know if this makes any difference, but I'm hosting this mysql server on my system. I have also tried the LOAD DATA LOCAL, but it makes no difference as \I get the same file not found error. Honestly at my wits end here. Everyone online just talks about changing backslashes to front-slashes or double back-slashes, none of which make any difference. Please help of any form would be appreciated.

6
  • make sure the '--secure-file-priv' option is turned off, see: stackoverflow.com/questions/37596163/… Commented Nov 28, 2021 at 15:29
  • Did you also check if the file is really at that location, using: \system dir "C:\Users\ehize\Downloads\not414.csv" ? Commented Nov 28, 2021 at 15:36
  • In the end, I think the issue was with my table column data types Commented Dec 10, 2021 at 20:20
  • No, this would lead to other error messages, and not to the error you where reporting ... ("OS errno2 no such file or directory") Commented Dec 11, 2021 at 9:54
  • So what would lead to that error? Commented Jan 6, 2022 at 19:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.