I have a Linux server (Centos 7) running WordPress and another Linux server (Ubuntu) running MySQL. Communication between WordPress and the Database was working. However, after a web server reboot, I see the following message in the browser:
It was determined that Apache was not running via: ps -ef | grep http
I manually started Apache via: service httpd start
**** I do want Apache to start automatically after a server reboot ****
Now Apache returned the following message in the browser: Error establishing a database connection
After attempting to test the connecting via: mysql
Linux returned the error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
The directory, '/var/lib/mysql/', is empty. I read on the Internet, that when the MySQL service runs, it creates the socket. When exited, the socket file is removed. Not sure this is true or not.
So it appears to be a MySQL socket issue.
Looking forward to everybody's help on this...
chkconfig --add httpd
I think on Centos 7. Connect to a different host:mysql -h hostname -u user -p
config/config.php
orconfig/database.php
etc.mysql -u dbuser -h xxx.xxx.xxx.xxx -p