By using AWS re:Post, you agree to the Terms of Use

AWS Lightsail Error Message saying “Error establishing a database connection"


Hello, there. We are currently facing an issue on using AWS Light with Wordpress. The error message shown on website was “Error establishing a database connection". This appears whenever we launch any instances. The first time we found the error, we were using Wordpress side for putting some e-commerce plugins and heard a developer doesn’t think he touched any database connections.

As we cannot figure out the problem by ourselves, we would like to know the reason why this occurs. Till now we don't know how to solve this so the developer just snapshoted the previous instance and made new one to revive the website. Even though we restart the new instance, we got errors which I indicated above.

Thanks in advance.

  • This appears like a configuration issue? But before diving deeper; Do you mean that the Website was working well before the issue occurred?

1 Answer


Sorry to see you're encountering this issue. This error likely means either the username/password combination for Wordpress connecting to the database set in wp-config.php is incorrect, or the database isn't running. Here are a few things I'd try:

  1. See if the database is running. You can use the command ps aux | grep mysql to see if there's a mysql process running.
  2. Check your wp-config.php file to ensure that the database credentials set there are correct.
  3. Check the instance's disk space (df -h) to ensure it's not full.

I hope those steps help you figure out the issue. Thank you for using Amazon Lightsail!


answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions