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
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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With