ERROR 1 (HY000): Can't create/write to file '/tmp/#sql_909_0.MYI' (Errcode: 13)

mysql> desc tablename;
ERROR 1 (HY000): Can't create/write to file '/tmp/#sql_909_0.MYI' (Errcode: 13)

两种解决办法:
方法一:
1、chmod 777 /tmp
[root@localhost /]# chmod 777 /tmp
chmod: 更改"/tmp" 的权限: 只读文件系统 --遇到这种情况,tmp权限无法更改。

2、/etc/init.d/mysqld start

方法二:
1、mkdir /var/lib/mysql/tmp
2、chmod 777 /var/lib/mysql/tmp
3、编辑:/etc/my.cnf
# The MySQL server --在该位置添加临时目录
[mysqld]
tmpdir=/var/lib/mysql/tmp
4、/etc/init.d/mysqld start

经过修改中的修改我的mysql正常运行了。

其它情况:df -h命令查看磁盘使用情况,发现/tmp使用率100%,清除tmp下不必要的文件后,一切正常。

原文地址:https://www.cnblogs.com/rusking/p/4621034.html