I've installed a fresh copy of Wordpress on CentOS 7/Apache but am getting the dreaded "Error establishing a database connection" error message when navigating to the site to complete the setup. I've created a new database for Wordpress to use, along with a user which has all privileges on it.
My MySQL (MariaDB) installation is on a separate host, however I can connect to it fine with the command line client:
mysqlshow -u <wordpress_db_user> -p -h <host ip>
shows information_schema
and <wordpress_db_name>
in the list of Databases, and
mysql -u <wordpress_db_user> -p -h <host_ip> <wordpress_db_name>
opens a session as expected - however there's nothing to query as WP has not set up its tables yet. I've even tried
sudo -H -u apache bash -c 'mysql -u <wordpress_db_user> -p -h <host_ip> <wordpress_db_name>'
to make sure that SELinux isn't blocking apache
from connecting.
Is there anything else I can check to get this working? Most of the guides out there stop at "Have you got the right credentials" and "Have you tried repairing the database"...