I am getting Error establishing a database connection
while trying to connect to mysql on Amazon RDS from my Wordpress instance.
Wordpress is on my AWS Linux EC2 Instance, both are on the same VPC, same Security Group allowing 3306 inbound rule, db credentials in wp-config is also correct.
I am able to connect to my mysql RDS instance while ssh with the following command and it connects fine:
mysql -h "endpoint url" -u "username" -p "password";
However, when accessing the EC2 EIP on the browser to setup my WP final configuration I get the error connecting DB.
mysql
command, but WordPress (on the same EC2 instance) is unable to connect to RDS? If so, the problem is clearly not related to networking. It would likely be a configuration issue (URL, username, password). Hopefully you'll find a helpful message in one of the WordPress logs. – John Rotenstein