Home >PHP Framework >YII >Where is the yii database configuration?
Configure database information in the common->config->main-local.php file. Directly open the main-local.php file to configure the information for connecting to the database.
We use mysql database:
'db'=> [ 'class'=>'yii\db\Connection', 'dsn'=>'mysql:host=localhost;dbname=mydb', 'username'=>'root', 'password'=>'root', 'charset'=>'utf8', ]
Recommended learning: yii tutorial
The above is the detailed content of Where is the yii database configuration?. For more information, please follow other related articles on the PHP Chinese website!