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 '' (13)." while installing drupal.

credentials are correct.

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

what could be problem ?


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.

  • 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 errors was a local outbound firewall rule. – danblack Sep 22 '18 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.