关闭selinux和iptables

  在上mysql的课的时候,老师老是提示千万千万必定要关闭selinux和iptables。否则可能会出现什么乱七八糟的权限问题等等。我也找到一篇文章是关于这个的。mysql

  连接为https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql。linux

  文章当中说到了两种解决方法,一个是锤子,一个是手术刀。本人如今水平有限,就只用锤子就能够了,简单有效。sql

  永久性的关闭selinuxoracle

  编辑文件 /etc/selinux/configspa

# 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=enforcing
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
把配置文件当中的绿色部分改为disabled,而后重启就能够了。
重启之后,用getenforce 来查看是否关闭成功。blog

若是出现Disabled,就表示你关闭成功了。three

 

如今是永久中止iptables的时候。ip

先查看iptables的状态。ci

输入命令 systemctl status iptables.service get

若是出现Active: active (exited) 表示你仍是开着的。

想要关闭的话很简单,

先用systemctl stop iptables.service

而后再用systemctl disable iptables.service 就能够了。