小编典典

表'/tmp/#sql_3c51_0.MYI'的密钥文件不正确;尝试修复它

mysql

我写了一个查询,它可以在本地服务器上正确运行,它的数据较少,

但是,当我在生产服务器上运行它时,会出现错误-(此数据在6GB左右)

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

这是我的查询

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;

任何人都知道如何从该错误中恢复-诸如优化此查询或其他任何方式的谢谢


阅读 318

收藏
2020-05-17

共1个答案

小编典典

做这些步骤

停止mysql服务

将.myi文件重命名为x.old

启动mysql

修复查询中的所有表,MySQL将重建密钥文件

2020-05-17