我最近在我的mysql数据库上出现了一个错误并且没有更好的判断力(我根本不是服务器人)我试图通过谷歌搜索和更改服务器来解决它......
首先,mysql显示此错误"无法创建/写入文件(错误代码:30)"
我想我遵循了这些答案,最终导致了更多问题: MySQL: Can't create/write to file '/tmp/#sql_3c6_0.MYI' (Errcode: 2) - What does it even mean? http://nixcraft.com/showthread.php/14260-ERROR-1-(HY000)-Can-t-create-write-to-file-tmp-sql_9f3_0-MYI-(Errcode-13)
只回头看,我发现这些谷歌搜索的答案有不同的错误代码,而不是" 30"
以下是我所做的操作的日志,导致服务器在最后失败甚至更多(mysqld现在甚至没有重启)
[root@xxx ~]# /usr/sbin/lsof /tmp
[root@xxx ~]# /bin/umount -l /tmp
umount: /tmp: not mounted
[root@xxx ~]# /bin/umount -l /var/tmp
umount: /var/tmp: not mounted
[root@xxx ~]# cat /etc/my.cnf | grep tmpdir
[root@xxx ~]#
[root@xxx ~]# cat /etc/my.cnf | grep tmpdir
[root@xxx ~]# chown root:root /tmp
chown: changing ownership of `/tmp': Read-only file system
[root@xxx ~]# chmod 1777 /tmp
chmod: changing permissions of `/tmp': Read-only file system
[root@xxx ~]# /etc/init.d/mysqld restart
rm: cannot remove `/var/lock/subsys/mysqld': Read-only file system
rm: cannot remove `/var/lib/mysql/mysql.sock': Read-only file system
Stopping mysqld: [ OK ]
Starting mysqld: [FAILED]
[root@xxx ~]# chmod 777 /var/lock/subsys/mysqld
chmod: changing permissions of `/var/lock/subsys/mysqld': Read-only file system
[root@xxx ~]# chmod 777 /var/lib/mysql/mysql.sock
chmod: changing permissions of `/var/lib/mysql/mysql.sock': Read-only file system
[root@xxx ~]# /etc/init.d/mysqld restart
Stopping mysqld: [FAILED]
Starting mysqld: [FAILED]
[root@xxx ~]# /etc/init.d/mysqld restart
Stopping mysqld: [FAILED]
Starting mysqld: [FAILED]
[root@xxx ~]#
从上面列出的链接中,您会看到我尝试过诸如
之类的内容"check mysql config : my.cnf
cat /etc/my.cnf | grep tmpdir
I can't see anything in my my.cnf
add tmpdir=/tmp to my.cnf under [mysqld]
restart web/app and mysql server
/etc/init.d/mysqld restart"
" chown root:root /tmp
chmod 1777 /tmp
/etc/init.d/mysqld restart"
但是,是的,我还没有触及它,因为我认为我只会把它弄得更糟。
运行的服务器是CentOS 6.5 64位LAMP
让我知道是否有人可以提供一些见解或我是否应该提供更多信息。谢谢!非常感谢。