2

I get error "Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '192.168.0.20' (13)." while installing drupal.

credentials are correct.

on webserver: mysql -u dbuser -h 192.168.0.20 -P 3306 -D drupal -p works fine.

what could be problem ?

1 Answers1

2

I'm going to assume its a selinux denial and

setsebool -P httpd_can_network_connect_db 1

will allow the php running in the web server to connect to the mysql port.

danblack
  • 1,249
  • 13
  • 15
  • You're welcome. Glad it worked. The small hint in your error message is 13 which corresponds to EPERM, permission denied. The other alternative looking at potential [connect](http://man7.org/linux/man-pages/man2/connect.2.html) errors was a local outbound firewall rule. – danblack Sep 22 '18 at 08:23