In the Yii2 Framework application I am using the "advanced" template, I am having difficulty making the connection.
Where in the framework is the connection to the mysql database made?
In the Yii2 Framework application I am using the "advanced" template, I am having difficulty making the connection.
Where in the framework is the connection to the mysql database made?
The file that must declare the connection to the database is main-local.php The print below shows the exact place where you are.
Within the file you should find something like this.
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=nome_base_de_dados',
'username' => 'nome_utilizador',
'password' => 'password_base_de_dados',
'charset' => 'utf8',
],
],
Where you should only change the data access to the database.