数据库连接permission denied

通常情况下载安装完CentOS7后,默认情况下SElinux是启用状态

此时,需要将SElinux关闭

[root@localhost ~]# sestatus  
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      31


[root@localhost ~]# setenforce 0


[root@localhost ~]# sestatus  
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      31

如果要永久关闭,可以修改配置文件/etc/selinux/config,将SELINU置为disabled。

 

你可能感兴趣的:(linux,php,sql)