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.