I’m trying to launch my application on AWS. I am not having the greatest of luck. I’ve managed to get the application uploaded and accessible. However, I am trying to get the database connection to work.
I have updated my db parameter settings according to this answer on Stack Overflow.
Still despite updating the parameters, I still get the following error:
SQLSTATE[HY000] [2002] Connection refused
Caused by: PDOException
SQLSTATE[HY000] [2002] Connection refused
I tried switching the security group rules to allow all inbound traffic, but this too did not help.
Any and all guidance would be appreciated it. I have been fighting this for a few days and have followed the guides on AWS to the T. I have created and destroyed several environments and databases at this point lol.
If someone has launched yii2 on AWS ElasticBeanstalk, I would greatly appreciate some guidance as I am lost.
Maybe i am wrong, but why don’t you just connect to the RDS system trough the configuration given from AWS? Like the example you can see from my previous comment. Open the RDS view where all database are listed, then you can see the informations for a given Database in order to connect.
The documentation link from above is seems to be regardings beanstalk - not sure - just took a quick look at the breadcrumbs
According to your error you’re security group for your server isn’t correct. You need to make sure that your inbound rule on your servers security group for 10.0.0.0/16 (or your Internal AWS Connections) is set to “all” (or just the specific port(s) you are using). This way your server can talk to your DB.
I finally was able to get the server to connect with the DB. In truth, I didn’t do anything different. I deleted everything and started over, following their guide.
Now my next question is, how do I access the console in order to do the database migrations? Not sure how to reach the source files from a command line.