An error is returned when the temporary MySQL table is too large.

Source: Internet
Author: User

Mysql reports the following error:

ERROR 126 (HY000): Incorrect key file for table '/tmp/# SQL _6613_0.myi'; try to repair it

The reason is that the temporary table is too large, and the/tmp partition is only 2 GB. If it cannot be put, an error is returned.
If you create a temporary table with the intermediate results

Create temporary table tmp select...

The created table file is only about mb. Why cannot it be stored in/tmp?
I guess the temporary tables created by MySQL are all static rows (no data is found for confirmation ). This is because

Create temporary table tmp row_format = fixed select...

The same error occurs when you create a table.

Therefore, there are two solutions to this problem:
1. Create a temporary table by yourself. It takes time to modify the code.
2. Increase the temporary directory.
1.1 you can increase the/tmp partition,
1.2 you can set the TMPDIR environment variable when starting MySQL to specify another temporary directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.