1. 程式人生 > >mysql啟動報錯,提示MySQL is not running, but PID file exists

mysql啟動報錯,提示MySQL is not running, but PID file exists

mysql所在機器關機重啟後,mysql無法啟動,啟動一直報錯MySQL is not running, but PID file exists,

嘗試了所有的啟動方式,都無法啟動,在使用mysqld restart啟動時,看到一個提示說:

/usr/sbin/mysqld:cant't change dir to 'XXXX'

想到這個可能是許可權導致的問題,進行查詢發現,許可權沒有問題,根據百度提示的selinux,

設定為permissive模式之後正常啟動mysqld。

程式碼如下:

[[email protected] selinux]# getenforce
Enforcing
[
[email protected]
selinux]# setenforce 0 [[email protected] selinux]# getenforce Permissive
徹底修改selinux模式,vim /etc/selinux/config 修改SELINUX=disabled

程式碼如下:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted