tags:

views:

26

answers:

1

Hi,

Incorrect key file for table '/tmp/#sql_185e_0.MYI'; try to repair it

What does this error mean?

"Incorrect key file for table '/tmp/#sql_185e_0.MYI'; try to repair it"

I'm inserting 400k records in a table by 25k per batch using PHP in command line. If I inserted only 1k records then it will not produce the MySQL error.

Does the error mean that my server has no more disk space?

Thanks.

+1  A: 

According to google - this error often related to not enough space for the drive your temporary directory is located at.

zerkms
Thanks zerkms. It seems that the server's /tmp/ directory has no disk space left. These linux commands are useful in solving my error: fg, screen, ps -ef, free -m, top and df -lh.
marknt15
SO markup ate the solution ;-)
zerkms
Also, I added a PHP mysql_free_result($result) after my select statements to free some space :) Thanks
marknt15
@marknt15: if you did not get fatal errors about not enough memory - then `mysql_free_result()` usage is not obligatory. I even would say it is pointless.
zerkms