0

I would like to allow my laravel project to connect to a DB which is in EC2 instead of localhost(in my PC). Is it possible or not?

I tried to look up for how to connect. However, I couldnt find it.

original

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mydb
DB_USERNAME=root
DB_PASSWORD=

Db info I want to connect

MySQL host:localhost
username:root
password:password

SSH host : xxx.ap-northeast-1.compute.amazonaws.com
ssh USER: ec-2-user
SSH key: ~~~.cer
SSH port:
user2006734
  • 315
  • 4
  • 19
  • Have you checked https://stackoverflow.com/questions/25495364/laravel-mysql-db-connection-with-ssh? btw is it `RDS` or `local` in `EC2`? – Riz Feb 02 '22 at 14:29

0 Answers0