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

后端 未结 13 1960
無奈伤痛
無奈伤痛 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:42

    I had same error. Every time my EC2 server rebooted due to lack of memory. Mysql did not restart causing my websites to crash by showing "Error establishing a database connection" At first, I restart my server from WHM, that fixed the error immediately. The error return next time the server rebooted again. I also tried to ssh auto restart mysql database on boot commands, but that was not problem. All though my security group was setup to accept all traffic, I had to change my security group to include mysql, and reboot my instances to fix the error. I not sure if this will work for everyone with EC2. That worked for me

提交回复
热议问题