I spent a boatload of time trying to figure out why my web page couldn't connect to the DB.
First I realized that I needed to use an IP address in both the Mysql user permissions and the mysqli_connect call.
But it was still giving me this error on the web page.
2003:Can't connect to MySQL server on '192.168.86.54' (13)
I tried installing MySQL on the web server and was able to connect using the mysql client.
Finally I found this Stackoverflow article which said to set
setsebool -P httpd_can_network_connect_db=1
That worked. I ended up using this in my playbook.
- selinux:
state: disabled
I spent a boatload of time trying to figure out why my web page couldn't connect to the DB.
First I realized that I needed to use an IP address in both the Mysql user permissions and the
mysqli_connectcall.But it was still giving me this error on the web page.
I tried installing MySQL on the web server and was able to connect using the
mysqlclient.Finally I found this Stackoverflow article which said to set
That worked. I ended up using this in my playbook.