1

I'm trying to load data from a CSV using MySQL, but I'm getting Error code 29 (file not found). I'm using mac osx, but when I run the following query

LOAD DATA INFILE '/workspace/SQL_Test/src/values.csv' 
INTO TABLE queryid_vs_column
COLUMNS TERMINATED BY ','

MySQL tries to look in 'C:/workspace/SQL_Test/src/values.csv'. I haven't found anyone else with similar issues, has anyone encountered something like this? I'm not sure why MySQL thinks I'm running a windows machine.

Thanks.

3
  • What is the output of show variables like 'datadir'; ? Commented Sep 21, 2013 at 17:50
  • 1
    Is the MySQL server running on the Mac? LOAD DATA INFILE accesses files on the server, not the client. Commented Sep 21, 2013 at 17:52
  • Ahh okay, so does that mean LOAD DATA LOCAL accesses the client? @Barmar Commented Sep 21, 2013 at 17:56

1 Answer 1

5

If you don't use the LOCAL modifier, it accesses the file on the server. Change your query to:

LOAD DATA LOCAL INFILE '/workspace/SQL_Test/src/values.csv' 
INTO TABLE queryid_vs_column
COLUMNS TERMINATED BY ','
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I see now this was a silly question, sorry for that.

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.