MySQL connection not working from within Perl CGI script

时光总嘲笑我的痴心妄想 提交于 2019-12-06 06:11:51

Fixed it. In case anyone not too familiar with Linux administration faces similar issue, here's what had happened. The security system 'selinux' on my CentOS machine was prohibiting the httpd to establish network connection to the remote MySQL server. It had to be explicitly enabled with the following command

setsebool -P httpd_can_network_connect=1

One can read more about selinux over here:

http://wiki.centos.org/HowTos/SELinux

Check what users you have set up in MySQL. If you're trying to connect across a network connection, you could have a problem with the host association for the user.

Try: select host,user from mysql.user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!