0
votes

I've tried this a couple of times without any luck. I've got a new EC2 instance (Amazon Linux 2 AMI (HVM), SSD Volume Type - ami-0a0ad6b70e61be944). This instance is in the default VPC and region = US EAST 2 (Ohio). The EC2 is in a web-server security group that has inbound ports 80 & 22 open. The RDS is a MySQL instance "Dev/Test" and is in a security group that has has inbound port 3306 open for "my ip" and my web-server security group is added to this DB security group. I can SSH into my web-server without issues. I can launch my test page on my web-server without issues. Yes, I'm using the correct connection string details including credentials. However, the WordPress client on my EC2 fails to connect to my RDS with the following error: Error establishing a database connection This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at uday.cgakf6jnokhj.us-east-2.rds.amazonaws.com. This could mean your host’s database server is down.

Are you sure you have the correct username and password? Are you sure that you have typed the correct hostname? Are you sure that the database server is running?

Any help would be appreciatedenter image description here I've tried suggestions like directly adding the public and/or private IP of the EC2 into the Security Group of the RDS - no luck :-(

1
Can you check if you can establish a connection to the database port using telnet from the webserver?Maurice
What version of MySQL are you using?Marcin

1 Answers

0
votes

The tutorial in udemy had wrong instructions. This particular paper in AWS helped me overcome underlying issues - everything now works beautifully!! https://aws.amazon.com/getting-started/hands-on/deploy-wordpress-with-amazon-rds/5/

Thanks!