views:

217

answers:

1

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
+1  A: 

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

else check if apparmor is active for your directory

Pierre
tried this but now I get an SQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LOCAL DATA INFILE '/Users/name/Desktop/loadIntoDb/loadIntoDB.csv' INT' at line 1
Phill Pafford
it's LOAD DATA LOCAL INFILE since you lead me down the right path. Answer Accepted
Phill Pafford
ah, yes, sorry for the typo
Pierre