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

时间:2021-09-21 14:44:28

修表方法如下:

一法:. check table 和 repair table 方法
1,进入Mysql 的Dos控制台,输入密码进入

2,use database;(你的数据库名)

3, check table tabTest; 
如果出现的结果说Status是OK,则不用修复,如果有Error,可以用:

> repair table tabTest;

另外一个很可能的原因是临时文件夹空间不足,在进行大数据JOIN,ORDER BY时可能出现,这时需要修改临时文件夹路径

在启动命令中增加tmpdir参数:

/usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --pid-file="$mypidfile" --log-error="$errlogfile" --tmpdir=/var/tmp