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

Viewed 67312

I wrote a query and this runs on my local server correctly it has less data,

but when i run this on production server it gets an error - (this has more data around 6GB)

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

Here is my query

SELECT   
    `j25_virtuemart_products`.`virtuemart_product_id`,
    `product_name`, 
    `product_unit`,
    `product_s_desc`,
    `file_url_thumb`,
    `virtuemart_custom_id`, 
    `custom_value`   
    FROM 
    `j25_virtuemart_product_customfields`,
    `j25_virtuemart_products`,
    `j25_virtuemart_products_en_gb`,
    `j25_virtuemart_product_medias`,
    `j25_virtuemart_medias`     
    WHERE
    (
    `j25_virtuemart_products`.`virtuemart_product_id`=`j25_virtuemart_products_en_gb`.`virtuemart_product_id`
    AND 
    `j25_virtuemart_products`.`virtuemart_product_id`=`j25_virtuemart_product_customfields`.`virtuemart_product_id`)

AND

    `j25_virtuemart_products`.`virtuemart_product_id`=`j25_virtuemart_product_medias`.`virtuemart_product_id`
    AND 
    `j25_virtuemart_product_medias`.`virtuemart_media_id`=`j25_virtuemart_medias`.`virtuemart_media_id`

    GROUP BY `j25_virtuemart_products`.`virtuemart_product_id`

    LIMIT 0, 1000;

Anyone know how to recover from that error - something like otimize this query or any other way thank you

8 Answers

I used this following command and the error was gone:

mysqlcheck --all-databases -r #repair

I got this solution from the cpanel forum

Same problem to me

Run df -h to see if your partition /tmp have enough space

In my case /tmp was a overflow filesystem:

overflow 1,0M 24K 1000K 3% /tmp

What happened:

I had some problem here and my partition / was full, then Debian distro created a new partition /tmp in RAM memor, to use temporarily. This /tmp 1MB partition is not big enough for system use.

Solution: Run the following command to remove this temporary created partition /tmp

sudo umount -l /tmp

Related