I have a MySQL server running in RDS. I am able to connect to it when I'm running my website on localhost. But when I try to connect to myself through my website being hosted by the EC2 instance I can't connect. I tried looking through the security groups in the EC2 and it has as in inbound rule the following:
MYSQL/Aurora. TCP. 3306. 0.0.0.0/0
I'm sure the password, username, host, and database are correct because I can connect with them on localhost and through MySQL workbench.
I try to connect to mysql as follows:
$mysqli= mysqli_connect("blah.foo.us-west-2.rds.amazonaws.com:3306",'root','password', "innodb")or die($mysqli->error);