[ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_0.MYI'; try to repair it

리눅스/MySQL|2015. 1. 16. 11:27
반응형

mysql error 로그에 다음과 같은 에러가 반복적으로 나타날 경우에 대한 조치 방법입니다.

 

[에러]

110805 13:28:24 [ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_0.MYI'; try to repair it
110805 13:30:16 [ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_0.MYI'; try to repair it
110805 13:30:20 [ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_1.MYI'; try to repair it
110805 13:30:29 [ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_0.MYI'; try to repair it
110805 13:32:49 [ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_0.MYI'; try to repair it
110805 13:32:56 [ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_0.MYI'; try to repair it
110805 13:33:07 [ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_0.MYI'; try to repair it
110805 13:33:47 [ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_0.MYI'; try to repair it
110805 13:34:45 [ERROR] /usr/local/mysql/libexec/mysqld: Incorrect key file for table '/tmp/#sql_3922_0.MYI'; try to repair it

 

 

[해결] 

우선 파일이 임시로 저장되는 /tmp 폴더의 용량이 부족해서 위와 같은 에러가 발생 할 수 있습니다.

이런경우는 /tmp 파티션이 별도로 존재할 경우 그러한 경우가 많은데

아래 절차를 따라 해결이 가능합니다.

 

root@sysdocu:~# mkdir /home/tmp            // 용량이 넉넉한 파티션에 tmp 폴더를 생성하였습니다.

root@sysdocu:~chmod 1777 /home/tmp

root@sysdocu:~vi /etc/my.cnf

 tmpdir=/home/tmp 


root@sysdocu:~/etc/init.d/mysqld restart

 

 

[참고]

실상황에서 문제발생시 약 7G정도의 용량이 남은 /var/tmp 로 변경을 하였지만

같은 에러메세지가 발생하였고, /home/tmp 로 다시 변경하고 나서 문제가 해결되었습니다.

반응형

댓글()