Q:

Wordpress + Remote Database = Error Establishing Connection

I am trying to move my database offsite to a separate dedicated box which my wordpress can connect to remotely. I have already done the requisite dumps, imports, and permissions. After changing wp-config's DB_HOST from localhost to the remote IP, I am getting the big bold "ERROR ESTABLISHING CONNECTION" message and a blank page. 
I can currently access the remote mysql database from linux commandline using:
mysql -u USER -p -h REMOTE_IP

and everything works fine. so I know all the permissions are set up, and everything is in order.
Yet when I put the same credentials into the silly wordpress config, it's not working. Any ideas? I turned on mysql error logging but nothing is showing up from these failed attempts.

A:

This is old but I'll reply anyway in case anyone comes across this.
I had a similar problem earlier. My config file was correct and my database was remotely accessible from my box running apache, like your situation. I figured the problem had to be that apache wasn't allowed to make a connection to the database... or something along those lines.
That being said, try running this if SELinux is enabled:
setsebool -P httpd_can_network_connect=1

