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。

代码如下:

[root@data selinux]# getenforce
Enforcing
[root@data selinux]# setenforce 0
[root@data 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

问题参考:junjie的文章http://www.jb51.net/article/61107.htm



猜你喜欢

转载自blog.csdn.net/x917998124/article/details/79376498