Suddenly, wordpress cannot connect to my RDS. all configurations and inbound/outbound rules are correct. I also tried creating basic php function to connect.. I tried it on my local machine and it's working but not on my EC2 server.
$mysqli_connection = new MySQLi('xxxx.xxxxx.ap-southeast-1.rds.amazonaws.com', 'db_user', 'db_pass', 'db_name');
if ($mysqli_connection->connect_error) {
echo "Not connected, error: " . $mysqli_connection->connect_error;
}
else {
echo "Connected.";
}
Error: php_network_getaddresses: getaddrinfo failed: Name or service not known
Just this morning this happened, I didn't do anything at all. Maybe this is an Apache error or something? any help please?