Deekshith
1 week ago
127
8
General

Connect multiple Database in laravel

Posted 1 week ago by Deekshith

i want to connect databse which is present in another server, i can connetc to local server databses like below,

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db
DB_USERNAME=user
DB_PASSWORD=password


DB_CONNECTION=mysql_prelims
DB_HOST_2=127.0.0.1
DB_PORT_2=3306
DB_DATABASE_2=db
DB_USERNAME_2=user
DB_PASSWORD_2=password

How to connect to remote db in the .env file?

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