Karthic N
Karthic N

Reputation: 21

Database connection failed.Can't connect to MySQL server on '192.168.1.9' (13)

I have my php application coding in 192.168.0.8 but the database is in 192.168.1.9. When i tried to connect in CentOS server its throws error as Database connection failed.Can't connect to MySQL server on '192.168.1.9' (13). but when i tried connect the same DB from my localhost then its working. Can someone help and save my day. I also tried editing etc/my.conf file but nothing worked.

Upvotes: 0

Views: 985

Answers (1)

Karthic N
Karthic N

Reputation: 21

I found issue. It is because httpd_can_network_connect was disabled by default. Now i have set to enabled using setsebool -P httpd_can_network_connect=1 and its working now. Thanks for you interest.

Upvotes: 1

Related Questions