Disable selinux in centos without restarting
To disable SELinux:
Modify selinux = "" in the/etc/SELINUX/config file to disabled, and then restart.
If you do not want to restart the system, run the setenforce 0 command.
Note:
Setenforce 1 sets SELinux to enforcing Mode
Setenforce 0 sets SELinux to permissive Mode
Add selinux = 0 to the startup parameters of lilo or grub. You can also disable selinux.
#---------------------------------------------------------------
View selinux status:
/Usr/bin/setstatus-v
As follows:
SELinux status: enabled
SELinuxfs mount:/selinux
Current mode: permissive
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
Getenforce/setenforce view and set the current working mode of SELinux
#-----------------------------------------------------------------------
Once the service is started, it immediately stops. Search for information on the Internet and disable SELinux before installing MySQL. The steps are as follows:
1. Disable SELinux and restart the system;
2. Install MySQL (MySQL server should be able to start );
3. Enable SELinux and restart the system. Then the MySQL server can start normally.
Enable SELinux:
Vi/etc/selinux/config (also known as the/etc/sysconfig/selinux file)
SELINUX = disable SeLinux
SELINUX = enforcing enable SeLinux