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

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

    For me just restarting the mysqld service worked. There was a hitch though, as soon as I executed sudo service mysqld restart the MySql service stopped but didn't start. sudo services mysqld start gave a MySQL Deamon Failed to Start Error. I spent a lot of time trying to start the service but I guess the real culprit was the httpd service. I stopped the httpd service sudo service httpd stop. Now execute sudo service mysqld restart and bingo the wordpress site was back online(remember to start the httpd service). This sounds kind of lame but it worked, from what I figured out the MySQL DB stops for a number of reasons looking at the log and figuring out the actual reason is the only thing that works for me.

提交回复
热议问题