mysql:Can't start server: can't create PID file: No space left on device
作者:junjie 时间:2024-01-24 23:20:46
解决案例一:
今天公司服务器上所有的网站都出现问题,有的打开没有数据,有的直接是空白。
我的第一反应就是数据库挂了。打开远程,进了系统,service mysqld stop 失败。service mysqld start等了好大一会,提示Timeout error occurred trying to start MySQL Daemon
一开始以为是mysql用户问题,查询系统用户完全没有问题。
打开log日志一看,问题出现了Can't start server: can't create PID file: No space left on device;
df -h看了一下磁盘,500G的硬盘已经使用了100%,可用为0;
一咬牙删光了var/log文件夹。没想到的是log日志已经积累达到32G。
狂汗!!!而后启动mysql一切正常了。
解决案例二:
最近在维护linux服务器时发现,网站打不开了,经过检查发现是mysql数据库宕掉了,死活就是启动不起来。
然后看mysql日志文件
出现Can't start server: can't create PID file: No space left on device
这个错误。
提示磁盘空间不足
后用df -h 命令查看
竟然发现磁盘容量全部用完了,于是要查看是谁占用了
用命令:
find /tmp -size +100000000c
查找下磁盘中大于100M的文件
竟然出现:
tomcat的日志文件占用了443G,真是可恶啊啊
删掉此日志文件
rm -rf catalina.out
重新启动mysql即可。
最好重启linux os。
解决案例三:
mysql启动失败,日志显示如下:
120321 14:23:54 InnoDB: 1.1.8 started; log sequence number 1595695
120321 14:23:54 [ERROR] /usr/libexec/mysqld: Error writing file ‘/var/run/mysqld/mysqld.pid' (Errcode: 28)
120321 14:23:54 [ERROR] Can't start server: can't create PID file: No space left on device
120321 14:23:54 mysqld_safe Number of processes running now: 0
120321 14:23:54 mysqld_safe mysqld restarted
120321 14:23:54 [Note] Plugin ‘FEDERATED' is disabled.
120321 14:23:54 InnoDB: The InnoDB memory heap is disabled
120321 14:23:54 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
120321 14:23:54 InnoDB: Compressed tables use zlib 1.2.3
120321 14:23:54 InnoDB: Using Linux native AIO
120321 14:23:54 InnoDB: Initializing buffer pool, size = 128.0M
120321 14:23:54 InnoDB: Completed initialization of buffer pool
120321 14:23:54 InnoDB: highest supported file format is Barracuda.
120321 14:23:55 InnoDB: Waiting for the background threads to start
其实答案很简单,
No space left on device 没有磁盘空间了。 清理/var/log的空间!
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
SQL Server如何设置用户只能访问特定数据库和访问特定表或视图
![](https://img.aspxhome.com/file/2023/2/122352_0s.png)
对DataFrame数据中的重复行,利用groupby累加合并的方法详解
![](https://img.aspxhome.com/file/2023/0/105020_0s.jpg)
python 三种方法提取pdf中的图片
![](https://img.aspxhome.com/file/2023/1/95281_0s.jpg)
解决mysql不能插入中文Incorrect string value
python 公共方法汇总解析
JavaScript实现图片自动加载的瀑布流效果
![](https://img.aspxhome.com/file/2023/3/123373_0s.jpg)
微信小程序实现简单倒计时功能
![](https://img.aspxhome.com/file/2023/4/136304_0s.jpg)
PHP观察者模式原理与简单实现方法示例
![](https://img.aspxhome.com/file/2023/6/129446_0s.jpg)
Python retrying 重试机制的使用方法
![](https://img.aspxhome.com/file/2023/0/103770_0s.png)
python列表中remove()函数的使用方法详解
![](https://img.aspxhome.com/file/2023/8/94058_0s.png)
SUSE Linux下源码编译方式安装MySQL 5.6过程分享
使用python解析json字段的3种方式实例
![](https://img.aspxhome.com/file/2023/8/131318_0s.jpg)
在 TypeScript 中使用泛型的方法
![](https://img.aspxhome.com/file/2023/5/56195_0s.png)
PHP远程调试之XDEBUG
![](https://img.aspxhome.com/file/2023/9/129839_0s.jpg)
详解python3 GUI刷屏器(附源码)
![](https://img.aspxhome.com/file/2023/9/77719_0s.jpg)
python自动化测试selenium核心技术等待条件教程
![](https://img.aspxhome.com/file/2023/2/103792_0s.jpg)
图文详解如何在WordPress中嵌入iFrame
![](https://img.aspxhome.com/file/2023/6/55526_0s.png)
进行数据处理的6个 Python 代码块分享
python3 QT5 端口转发工具两种场景分析
![](https://img.aspxhome.com/file/2023/3/133423_0s.png)
Python3.5以上版本lxml导入etree报错的解决方案
![](https://img.aspxhome.com/file/2023/6/93856_0s.png)