Phill Pafford Phill Pafford - 5 months ago 22
MySQL Question

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

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

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

else check if apparmor is active for your directory