Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 (localhost, password and username).

I've read many of the questions and answers here but nothing helped me.

I have shell access so I can check everything that you need me to do. Maybe I should look at the configuration file for phpmyadmin to see what db connection settings are there, because phpmyadmin works, but I don't know where it is.

Thanks

like image 948
Idan Shechter Avatar asked Sep 06 '11 05:09

Idan Shechter


People also ask

What does it mean when it says error establishing a database connection?

This error means that your website files (on the webserver) are not able to connect to your database (on the database server). This article lists some common reasons this error could display on your site, including: Incorrect database credentials in your config file. The hostname isn't working.


1 Answers

Make sure you have installed mqsql client on your EC2 to establish connection to RDS MySQL(or any RDS DB). And install the DB dependencies, you would require to access RDS from Apache. Follow the link : https://aws.amazon.com/getting-started/hands-on/deploy-wordpress-with-amazon-rds/5/

like image 193
Pooja Gopal Avatar answered Oct 04 '22 03:10

Pooja Gopal