2010-07-19

You try to do:

load data infile ‘/home/you/yourfile.txt’ into table lol (username, foo);

and it says:

ERROR 13 (HY000): Can’t get stat of ‘/home/you/yourfile.txt’ (Errcode: 2)

It’s a permissions problem. Even if you chmdo 777 the file it still won’t work. Move your file to /tmp and try it again:

load data infile ‘/tmp/yourfile.txt’ into table lol (username, foo);

Success!

2 Responses to “MySQL: Can’t get stat of”

  1. Lucia Says:

    Thanks a lot for you suggestion, I was going crazy with this proble.
    Can you explain me why it works using the tmp folder?

  2. Josh Kearney Says:

    I recently came across this issue. The problem is that it’s looking in the wrong path, likely something it isn’t able to write to (hence your /tmp workaround). Try doing the same thing, only using ‘outfile’ — it will be saved to /usr/…/…/ somewhere.

    They need to make the error message a little more useful.

Leave a Reply


I've left the country and this site is just an archive! Check out my trip blog!