mysql load data infile can't get stat of file Errcode: 2

Phill Pafford picture Phill Pafford · Aug 12, 2010 · Viewed 84k times · Source

I have looked all over and found no solution, any help on this would be great.

Query:

LOAD DATA INFILE '/Users/name/Desktop/loadIntoDb/loadIntoDB.csv' 
INTO TABLE `tba`.`tbl_name` 
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(
field1, field2, field3
)

Error:

Can't get stat of '/Users/name/Desktop/loadIntoDb/loadIntoDB.csv' (Errcode:2)

NOTE:

I'm running MySQL Query browser on OSX 10.6.4 connecting to MySQL 5.x

Things I've tried:

  • Drag-n-drop
  • Chmod 777
  • Put in a folder with 777 permissions as well as the file having 777 permissions

Answer

Pierre picture Pierre · Aug 12, 2010

try to use LOAD DATA LOCAL INFILE instead of LOAD DATA INFILE

otherwise check if apparmor is active for your directory