I am getting the error: \"error establishing a database connection\" after moving my wordpress blog to Amazon EC2. I\'ve checked the wp-config.php file and settings are ok (loca
Got the same problem recently , I use the AWS free tier account. The ec2 instance is t2.micro, which has no swap pre-configured. When i installed wordpress stuff, the memory usage is always higher, even i do nothing. One day, i run a sudo yum update
command, the bash show that -bash: fork: Cannot allocate memory
error. And my website always got error establishing a database connection
too.
I think the root cause is high memory usage. You can add swap memory following the instruction here: How do you add swap to an EC2 instance?