--Build a web server and a DB server for Mysql 5.6 on CentOS 6.5. --Use the above web application from a client PC (Mac) in the same LAN --Use Python's mysql.connector to access Mysql
test.py
mysql.connector.connect(user='root', password='pass', host='127.0.0.1', database='hoge', charset='utf8')
When accessing the DB from a browser like
[2003] Can’t connect to MySQL server on ‘127.0.0.1’ (13)
I get angry
On CentOS
sudo setsebool -P httpd_can_network_connect=1
Then it went well.
This seems to allow httpd access.
I'm not sure, but it's working now, so it's okay w
Recommended Posts