F
F
frayer2020-03-12 18:05:53
SSH
frayer, 2020-03-12 18:05:53

How to connect remote database in Laravel using ssh?

hello, I need to connect the database of one project to another, how can this be done using ssh?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
part_os, 2020-03-20
@part_os

1. you need to establish a tunnel
ssh -i ~/keys/key.pem -N -L 13306:127.0.0.1:3306 [email protected]_ip
2 configure the appropriate connection in the laravel configuration
https://laravel.com/docs/5.8/database# configuration

C
craigy_waigy, 2020-05-16
@craigy_waigy

ssh -i ~/openssh_key -L YOUR_PORT:DATABASE_HOST:DB_PORT [email protected]_HOST

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question