關(guān)閉SELinux的方法:
修改/etc/selinux/config文件中的SELINUX="" 為 disabled ,然后重啟。
如果不想重啟系統(tǒng),使用命令setenforce 0
注:
setenforce 1 設(shè)置SELinux 成為enforcing模式
setenforce 0 設(shè)置SELinux 成為permissive模式
在lilo或者grub的啟動(dòng)參數(shù)中增加:selinux=0,也可以關(guān)閉selinux
#---------------------------------------------------------------
查看selinux狀態(tài):
/usr/bin/setstatus -v
如下:
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
getenforce/setenforce查看和設(shè)置SELinux的當(dāng)前工作模式
#-----------------------------------------------------------------------
發(fā)現(xiàn)服務(wù)一啟動(dòng),馬上停止,在網(wǎng)上查找資料,找到安裝時(shí)要先禁用SELinux,再安裝MySQL,步驟是:
1. 關(guān)閉SELinux,重啟系統(tǒng);
2. 安裝MySQL(MySQL server應(yīng)該可以啟動(dòng)了);
3. 啟用SELinux,重啟系統(tǒng),之后MySQL server就可以正常啟動(dòng)了。
啟用禁用SELinux的方法是:
vi /etc/selinux/config(也有人說(shuō)是/etc/sysconfig/selinux文件,其實(shí)兩個(gè)之間是鏈接關(guān)系,隨便改其中一個(gè),另一個(gè)也改了)
SELINUX=disable 禁用SeLinux
SELINUX=enforcing 啟用SeLinux