zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

centos7 centos中apache运行php需要连接mysql一直连不上,telnet访问mysql出错Connection closed by foreign host

2023-09-14 08:56:58 时间

执行命令:

getsebool -a|grep httpd 

发现 
httpd_can_network_connect off 


解决: 

setsebool httpd_can_network_connect 1 && setsebool httpd_can_network_connect_cobbler 1 && setsebool httpd_can_network_connect_db 1 && setsebool httpd_can_network_relay 1



需要重新启动httpd

systemctl restart httpd.service