I'm trying to install a wordpress installation where the DB will sit on a MySQL cluster (Galera/Percona XtraDB Cluster) and connected through HAProxy.

Everything outside of the Wordpress install seems to work fine. Using the mysql client to connect to the database with a username and password works just fine. The Wordpress install is on the same server as the HAProxy. That works fine from command line when I do this:

mysql -u wordpress -p<password> -h <haproxy ip> -D wordpress

However, from the install GUI page, it constantly takes me to the "DB connection failed" page.

Can anyone shed some light on where the issue might be? Here is what I'm attempting to use in the install from:

database name: wordpress
username: wordpress
password: <password>
database host: <ip of haproxy server>
table prefix: wp_

Thanks for any suggestions!

  • I've been wrestling with this for hours and finally found the answer 2 minutes after posting the question. SElinux was hosing me up. Disabled that and all is well. It shouldn't have been on so it was unexpected. At least the article is here for the future. Thanks.
    – SteveHNH
    Mar 29, 2013 at 15:44
  • Please add you solution as an answer. Explain step by step how you fixed it, that would be really useful.
    – fuxia
    Mar 29, 2013 at 16:32
  • Will do. It wouldn't let me add an answer for at least 8 hours. Will add it then. In the meantime: echo 0 > /selinux/enforce for temporary disable, or edit /etc/sysconfig/selinux and change from "enforce" to either "permissive" or "disabled." Permissive will log but not block, while Disabled turns it off entirely. Thanks!
    – SteveHNH
    Mar 29, 2013 at 20:51

2 Answers 2


SELinux was contributing to the problem. The main issue was that an HTML page was attempting to talk to another port on the localhost. I would not have seen the problem if the HAProxy was running on a separate host.

The log was revealed in /var/log/messages, where I should have checked but did not considering I didn't expect it. Fail on my part. The log looked like this:

setroubleshoot: SELinux is preventing the http daemon from connecting to network port 3306 For complete SELinux messages.

SELinux should not have been running to begin with, so I simply disabled it:

echo 0 > /selinux/enforce

To maintain this state upon reboot, simply edit the SELINUX line in /etc/sysconfig/selinux to say SELINUX=permissive rather than SELINUX=enforced. This will log alerts but not stop any processes. To disable SELinux completely, just replaced it with SELINUX=disabled instead.


it may be late to the party but just found this post and realized that if you have bandwidth why don't you try WordPress Cluster with Jelastic. Why I am saying that because its extremely easy to implement , its just

  • Login to Jelastic
  • create Environment
  • Select Apache and Server
  • Upload wordpress
  • Deploy.

:) if you are interested check the following link-


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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