Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

Solved. I created another rule for mysql in the security group, and I added only my IP. So, i have 2 rules for MySQL
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900