db.php文件是数据库相关的配置项
<?php
return [
'class' => 'yii\db\Connection',
//连接信息
'dsn' => 'mysql:host=localhost;dbname=rent',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
// Schema cache options (for production environment)
//'enableSchemaCache' => true,
//'schemaCacheDuration' => 60,
//'schemaCache' => 'cache',
];