I Tried all the above steps but didn't work. Even though, i have selected 'Publicly Accessible' while using visual studio, it didnt reflect in the aws console. So, the below steps worked for me. Please try this.
Note:- this is only for my testing/learning purposes. So, i made it publicly accessible. You might not enable publicly accessible if there is a security issue. If you are testing/using for learning purposes, you can follow the below approach.
Make sure your port is publicly accessible .Else you will not be able to connect.
To enable the public accesss, please follow the below steps.
- Select the db instance --> click Modify

- Scroll to connectivity Section, expand 'Additional configuration' section --> select 'Publicly Accessible'--> Scroll to bottom --> select update. (as shown below).

- Your db instance will be in modifying state and after 2-3 minutes it will be available. Now, give it a try to connect again and you will be able to connect now.