This morning, the wordpress powered website can not be open this morning, and the error message is ” Error establishing a database connection”.

I followed the solutions in this post first, but none of them worked. http://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/

  • Then nslookup the website url to get the website’s IP address.
  • ping the IP address, all can ping through,
  • logon from CPANEL, and also can logon the database phpmyadmin, means the Database is working.
  • Pretty sure I did not do any configuration change on the WordPress’s wp-config.php file. But still open it to double check has not been changed, nothing changed.
  • Then use nslookup to check the database server’s IP, found no result. So this is the problem! Then changed the DB_host value from mysql.hostinger.co.uk (my database server url) to localhost.Everything worked.

Guess the domain name system for the database server may got some issue.