Answer the question
In order to leave comments, you need to log in
How to connect to two databases in yii 2?
I connected to the first database using the db.php file.
Then I wrote the following code in config.php
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=rbac',
'username' => 'gallery',
'password' => 'gallery',
'charset' => 'utf8',
],
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question