Yii2 supports different database server types and each one have its own way to connect to database. To connect with any database we need to prepare DSN for connection.
In this quick tip we are going to see how DSN should be created for different Database servers.
If you are running basic app of Yii2 then you need to make this changes in db.php file under config directory and in case of advance application it should be done in main.php under config directory.
1 |
<?php |