WordPress: Error establishing a database connection

I have a site which is showing up this error message when I try to access it: “Error establishing a database connection”. The site url is http://www.hitec-asia.com/.

Here’s what I have done so far:

  1. Logged in to phpmyadmin to check all the tables, result was OK.
  2. Double checked and confirm my database connections settings at wp_config.php, everything was correct.

Is there anything else I can do about this? Any help rendered is greatly appreciated!


What relevant entries are there in PHP’s error log?

Hi SpacePhoenix,

Thanks for the reply.

I have input the following to wp_config but I am not able to see any debug.log file? Does that mean it has no errors or it’s some permission thing

// Enable WP_DEBUG mode
define('WP_DEBUG', true);

// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);

// Disable display of errors and warnings 
define('WP_DEBUG_DISPLAY', false);

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define('SCRIPT_DEBUG', true);

Is this after you went from a sandbox to live?
When this happened to me everything was correct in the config as well.

But i had forgotten to updated the database name from the one on my sandbox to the one on the server.

So I’d wonder if those settings are correct?
Good luck

Okay this is a very common problem. There is loads of help out there. My guess is that you need to replace some of your relative paths within your database. It may not just be a connection issue - http://www.wpbeginner.com/wp-tutorials/how-to-change-the-wordpress-database-prefix-to-improve-security/

Take a look at this post - http://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/