Could not connect: Can't connect to MySQL server on 'MYSQL.SERVER' (13)
无论如何修改MySQL的授权,或者调整php.ini中关于MySQL的设置,或者修改MySQL的监听网口,都无法解决。
而如果用命令行人工连接MySQL,则一切正常。
# 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
#把设置改为disabled
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
然后重启操作系统,即可生效。
或者,直接执行命令,可在线生效:
[root@imysql~]# setenforce 0
setenforce: SELinux is disabled