centos7 telnet访问mysql出错Connection closed by foreign host

类似以下错误
YB|m0A9mysql_native_password
	packets out of orderConnection closed by foreign host


执行命令: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

需要重新系统
reboot
shutdown -r now


ps:centos中apache运行php需要连接mysql一直连不上,
后来telnet发现端口能连但返回结果很怪异

你可能感兴趣的:(java,apache,PHP,mysql,centos)