Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Firemaps's avatar

Connecting to MySQL AWS, Security parameters?

Hi guys,

I am just after provisioning my first aws instance via forge and excited to get started

However, I'm having trouble connecting to mysql (pro, workbench)

I have been following this tutorial https://mattstauffer.co/blog/laravel-forge-hosting-on-aws which is great, but it stops short of configuring IPs and improving security.

Do I need to whitelist certain IPs from forge on my AWS security group?

I found this article https://forge.besnappy.com/laravel-forge And added the IP/32 to my Inbound SSH but still can't connect

Also, I'm not sure... do I need to use the .pem publickey that was generated or do I use the traditional id_rsa?

Just noticed too that if I add those IP from forge to my SSH security group, I am unable to login to forge via ssh ...

Hope someone can help me. Could really do with an article on maximizing security for aws + forge

And yes I have added my ssh key id_rsa to forge and have connected successfully to digital ocean before

Cheers

0 likes
3 replies
Firemaps's avatar

Using .pem and login as ubuntu worked as matt had pointed out in the article.

booni3's avatar

@firemaps I realise this is really old now, but I am having similar issues. I can connect to the RDS server via the EC2 instance but cannot get a connection via SSH tunnels to my local GUI.

You mentioned the .pem file, however this is not provided when provisioned with forge.

Did you find a different way to get this?

Firemaps's avatar

@LAMBOONI - Hey, yeah I figured it out. I have 2 servers running on AWS. The one I created myself via EC2 I need a .pem file to access that I got when creating the server and I needed to whitelist dedicated forge IP's in the AWS EC2 Security Group however the server created with forge automated most of this as far as I can remember.

Using Sequel Pro and the forge-provisioned server, the following params work for me

MySqlHost: ip

Username: forge

Password: forge-database-password

SSH Host: ip

SSH User: forge

With the server I created myself I needed to change

SSH User: ubuntu

SSH Key: ~/.ssh/pem/my-aws-key.pem

SSH Port : 22

Does this help ?

Please or to participate in this conversation.