How do you fix a MySQL “Incorrect key file” error when you can't repair the table?

前端 未结 10 1915
眼角桃花
眼角桃花 2020-12-13 08:53

I\'m trying to run a rather large query that is supposed to run nightly to populate a table. I\'m getting an error saying Incorrect key file for table \'/var/tmp/#sql

10条回答
  •  青春惊慌失措
    2020-12-13 09:25

    Your query is generating a result set so large that it needs to build a temporary table either to hold some of the results or some intermediate product used in generating the result.

    The temporary table is being generated in /var/tmp. This temporary table would appear to have been corrupted. Perhaps the device the temporary table was being built on ran out of space. However, usually this would normally result in an "out of space" error. Perhaps something else running on your machine has clobbered the temporary table.

    Try reworking your query to use less space, or try reconfiguring your database so that a larger or safer partition is used for temporary tables.

    MySQL Manual - B.5.4.4. Where MySQL Stores Temporary Files

提交回复
热议问题