David David - 1 year ago 200
MySQL Question

MySQL cannot find data file for a load operation

I would like to load a data file into MySQL using the following command,

LOAD DATA LOCAL INFILE '/Users/David/Desktop/popularity20110511/test_data' INTO TABLE test_table

The above command gives me the following error

#7890 - Can't find file '/Users/David/Desktop/popularity20110511/test_data'.

I've also tried

LOAD DATA INFILE '/Users/David/Desktop/popularity20110511/test_data' INTO TABLE test_table

I also gives me an error

#13 - Can't get stat of '/Users/David/Desktop/popularity20110511/test_data' (Errcode: 13)

I've repeatedly checked the file path and name and I've also made sure the file privilege is set to
Read & Write
for everyone.

I am using a Mac and phpMyAdmin.

Any suggestions on what the problem may be?

Answer Source

I'm not too sure what the problem is but I made it work by moving the file to /tmp/test_data and used LOAD DATA INFILE...