Tech Corner

Seems Familier screen below lets dive deeper to troubleshoot this and get you website up and running in no time. This is very common error and can be fixed easily.

There are few things you can look for

  1. If you did not make any change check with the provider if the server which hosts the database is available and wait for it to come back up. if thats not the case and you made sure that thats not the case then follow below article.

“Error establishing a database connection”

is an error message that appears when WordPress is unable to connect to the database. This can be caused by several factors, such as incorrect database credentials (username, password, or host), an issue with the database server, or a problem with the website’s code.

To troubleshoot this issue, you can try the following:

  1. Check your database credentials (username, password, and host) in your wp-config.php file to ensure they are correct.
  2. Make sure the database server is running and accessible. Contact your hosting provider if you’re not sure.
  3. Check if there is any issue with the database server, you can check the database server logs.
  4. Deactivate all plugins to see if one of them is causing the issue.
  5. Check if your website’s code is not causing the issue by checking the recent changes in the code.
  6. If the above steps don’t work, you may need to contact your hosting provider for further assistance.

It is very important to keep a backup of your website before making any changes. Cannot stress enough to this. Website is a living document and evolves over time and replacing it would be very costly and time consuming. Wordpres has a very sold backup system available and for a basic backup which most individuals can get away with is FREE.

Looking to change the password of WP Database (if you need help call us at 416-826-5859)

To modify the wp-config.php file to put in new database credentials, you can follow these steps:

Note: before you start you would require to reset your password for database: Please follow my another article which talks on how to reset a database password.

Steps to change the password in the wp-config.php

  1. Log in to your website’s server using FTP or cPanel file manager.
  2. Locate the wp-config.php file, which is usually in the root directory of your WordPress installation.
  3. Download a copy of the file to your local computer as a backup.
  4. Open the file in a text editor, such as Notepad or Sublime Text.
  5. Look for the following lines of code:
define('DB_NAME', 'database_name');
define('DB_USER', 'database_username');
define('DB_PASSWORD', 'database_password');
define('DB_HOST', 'database_host');
  1. Replace ‘database_name’, ‘database_username’, ‘database_password’, and ‘database_host’ with your new database credentials.
  2. Save the changes and upload the modified file back to the server, replacing the old version.
  3. Once you have done these changes, you should be able to connect to your database with the new credentials and the error message should be resolved.

Please be careful when making changes to the wp-config.php file, as even a small mistake can cause your website to stop working.

More detailed article:

Leave A Reply