service mysqld stop
MySQL server PID file could not be found! [FAILED]
MySQL 進程仍在運行,但 PID 檔案遺失或路徑不符,導致 init 腳本找不到 PID 而無法正常停止。
ps aux | grep mysqld
# 例輸出:
# mysql 16058 0.2 11.2 995540 112956 ? Sl 14:07 0:01 mysqld
kill -9 16058
service mysqld start
# 或
service mysqld restart
可能需重試 2-3 次,直到出現 [OK]。
my.cnf 中 pid-file 路徑與目錄權限正確 (擁有者 mysql:mysql)/var/run/mysqld/ 目錄systemctl 管理服務 (CentOS 7+),減少 PID 檔案依賴[root@web1 ~]# service mysqld stop
MySQL server PID file could not be found! [FAILED]
[root@web1 ~]# service mysqld restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL.. [OK]
[root@web1 ~]# service mysqld restart
Shutting down MySQL. [OK]
Starting MySQL.. [OK]