I am able to connect to my RDS instance from the terminal(SSH), however, connecting from my application had been returning error code 500: Internal Server Error.
I have configured my security group to be the security group that i am using for the EC2 instance.
In my security group, I have created rule for mysql connection via port 3306, from any IP (0.0.0.0/0)
Attached is the image of my security group and the RDS instance.
I have tried many suggestion from the answers posted here on stackoverflow.
<!-- begin snippet: js hide: false -->
<!-- language: lang-html -->
echo "OK before connection";
$dsn = 'mysql:host=klaudcelet-db.cwjchxqjfoaj.eu-central-1.rds.amazonaws.com;port=3306;dbname=providers';
$username = 'klaudcelet';
$password= '12345678';
//not the real password
$link = mysqli_connect('klaudcelet-db.cwjchxqjfoaj.eu-central-1.rds.amazonaws.com', 'klaudcelet', '12345678', 'providers', 3306);
echo "First OK";
$dbh = new PDO($dsn, $username, $password);
echo 'OK';
<!-- end snippet -->
[My security group rules][1]
[rds configuration][2]
Thanks.
[1]: http://i.stack.imgur.com/Zng4L.png
[2]: http://i.stack.imgur.com/E6Jnc.png