Error establishing a database connection Amazon EC2 - after moving my wordpress blog

后端 未结 13 1957
無奈伤痛
無奈伤痛 2021-02-01 09:03

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

13条回答
  •  再見小時候
    2021-02-01 09:30

    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?

提交回复
热议问题