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
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