Database connection with a AWS server created with Forge.

Posted 1 month ago by HCK

Hello, I've added my AWS keys and created a server with Forge (region: Virginia). Then, I created a site and added it the repository to pull the code from. So good so far. The thing is, I didn't activate quick deploy in that moment.

By the way, I created a database when creating my site.

Now I push my code and needed to run mi migrations.. but I got this message:

We were unable to deploy to server (MY_SERVER_NAME).

  Exception trace:

  1   PDOException::("SQLSTATE[HY000] [2002] Connection refused")

  2   PDO::__construct("mysql:host=;port=3306;dbname=my_db_name", "my_db_user", "my_db_password", [])

Now, this is the first time that I use AWS. I did all this things on DigitalOcean and haven't had a problem until now.

I checked my .ENV file and my keys are configured like this:

DB_HOST=       // <---- this is the actual value
DB_PORT=3306       // <---- this is the actual value

Are this DB_HOST/DB_PORT keys appropiate when using AWS? I've tried to search information about it but so far nothing.

Thanks in advance.

Additional question, given the amount of services provided by AWS.. when using Forge to manage the server through AWS.. Are the databases created inside the VPC? OR are they created in RDS/etc?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.