I created an SSH port tunnel:
ssh -f -N -L 3306:localhost:3306 myuser@thedomain.com
On that same machine where I created the port tunnel, I can connect to mysql by doing:
mysql -h 127.0.0.1 -u user -p
On that same machine, if I try to make Wordpress connect to MySQL, none of the following work:
/** MySQL hostname - NONE of these work */
define('DB_HOST', 'localhost');
//define('DB_HOST', 'localhost:3306');
//define('DB_HOST', '127.0.0.1');
//define('DB_HOST', '127.0.0.1:3306');
Why can't WordPress connect?
I tried restarting httpd
but that didn't fix the issue.