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

0

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?

已提問 2 年前檢視次數 1804 次
1 個回答
0

Hello,

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!

-Maxwell

Maxwell
已回答 2 年前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南