Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't connect Amazon rds database in Amazon ec2?

I have a console application that has Amazon rds connection with Entity Framework . It is running well in my local PC. But When I am running my application in Amazon EC2 It can not connect to my Amazon RDS database and saying 'The underlying provider failed on open' . My connection string of entity framework is ...

<add name="MyEntities" connectionString="metadata=res://*/YhFinModel.csdl|res://*/YhFinModel.ssdl|res://*/YhFinModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=datasourcename,portnumber;initial catalog=databasename;persist security info=True;user id=userid;password=password;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Thanks in advance.

like image 582
wahid_maruf Avatar asked Dec 06 '22 07:12

wahid_maruf


1 Answers

Have you looked at your security groups? I think you will need to add the EC2 security group you are using to have port access to your RDS instance.

like image 51
Keenan Avatar answered Dec 27 '22 11:12

Keenan