[Linux] su: cannot set user id: Resource temporarily unavailable解决
今天ssh mysql db 测试服务器,进去切换成Mysql帐号报错如下:
登陆mysql报错如下:
[xxx@xxx-c003db2 ~]$ mysql -uroot -
ERROR 1135 (HY000): Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug
切换进mysql用户进去检查:
[xxx@xxx-c001db2 mysqldata]$ sudo su - mysql
su: cannot set user id: Resource temporarily unavailable
经过检查,确定是mysql有一个目录/data/磁盘满了,测试服务器是虚拟机,所以让sa给/data/目录增加了100M空间之后,就可以sudo su 进去了:
[xxx@xxx-c001db2 mysqldata]$ sudo su - mysql
[mysql@xxx-c001db2 ~]$
[mysql@xxx-c001db2 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/Sys-root 1008M 222M 736M 24% /
tmpfs 16G 12K 16G 1% /dev/shm
/dev/vda1 485M 29M 432M 7% /boot
/dev/mapper/Sys-home 5.0G 146M 4.6G 4% /home
/dev/mapper/Sys-tmp 2.0G 68M 1.9G 4% /tmp
/dev/mapper/Sys-usr 5.0G 794M 3.9G 17% /usr
/dev/mapper/Sys-var 4.0G 526M 3.3G 14% /var
/dev/mapper/Sys-crash
4.0G 137M 3.7G 4% /var/crash
/dev/mapper/Sys-log 6.0G 1.7G 4.0G 30% /var/log
/dev/mapper/Sys-audit
2.0G 93M 1.8G 5% /var/log/audit
/dev/mapper/Sys-vtmp 1008M 34M 924M 4% /var/tmp
/dev/mapper/Sys-opt 9.9G 424M 9.0G 5% /opt
/dev/mapper/Sys-mysqlbackup
62M 5.3M 54M 9% /mysqlbackup
/dev/mapper/Sys-mysqldata
130G 124G 0 100% /mysqldata
/dev/mapper/Sys-mysqllog
9.9G 152M 9.2G 2% /mysqllog
9.5G 0 9.5G 0% /mysqldata/shared
呵呵,赶紧去清理磁盘上爆发增长的binlog日志吧,今天tester在做高并发测试。