MySQL, Error 126: Incorrect key file for table

前端 未结 5 1452
一向
一向 2020-12-03 04:35

I read the following question that has relevance, but the replies didn\'t satify me: MySQL: #126 - Incorrect key file for table


The problem

When runn

5条回答
  •  旧时难觅i
    2020-12-03 05:27

    It appears that your query is returning a large intermediate result set requiring the creation of a temporary table and that the configured location for mysql temporary disk tables (/tmp) is not large enough for the resulting temporary table.

    You could try increasing the tmpfs partition size by remounting it:

    mount -t tmpfs -o remount,size=1G tmpfs /tmp
    

    You can make this change permanent by editing /etc/fstab

    If you are unable to do this you could try changing the location of disk temporary tables by editing the "tmpdir" entry in your my.cnf file (or add it if it is not already there). Remember that the directory you choose should be writable by the mysql user

    You could also try preventing the creation of an on disk temporary table by increasing the values for the mysql configuration options:

    tmp_table_size
    max_heap_table_size
    

    to larger values. You will need to increase both of the above parameters

    Example:

    set global tmp_table_size = 1G;
    set global max_heap_table_size = 1G;
    

提交回复
热议问题