In one of my project, I am getting this error while accessing the website.
When I restarted RDS instance, the problem was solved and website was running.
After 2 days, again I am getting the same error. But after restarting RDS, Problem is solved. I am not able to figure out this problem. Please help.
Look at this tutorial, it covers the whole process but you may skip to the last part: Using Amazon RDS with your WordPress installation
I had the same issue with AWS Lightsail.
Solved as follows :
(https://aws.amazon.com/premiumsupport/knowledge-center/lightsail-wordpress-fix-database-errors/):
DB_USER
andDB_PASSWORD
as set from database instance(https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-connect-wordpress-to-mysql-managed-database):
(https://linuxize.com/post/start-stop-restart-apache/)