程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> 關於MYSQL數據庫 >> mysql:Cant start server: cant create PID file: No space left on device

mysql:Cant start server: cant create PID file: No space left on device

編輯:關於MYSQL數據庫

解決案例一:

今天公司服務器上所有的網站都出現問題,有的打開沒有數據,有的直接是空白。

我的第一反應就是數據庫掛了。打開遠程,進了系統,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的空間!

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved