yii2 数据库表名前缀设置
'tablePrefix' => 't_', //数据库表名前缀
<?php return [ 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=数据库名', //数据库名 'username' => 'root', //数据库用户名 'password' => 'root', //数据库密码 'charset' => 'utf8', 'tablePrefix' => 't_', //数据库表名前缀 ], 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'viewPath' => '@common/mail', // send all mails to a file by default. You have to set // 'useFileTransport' to false and configure a transport // for the mailer to send real emails. 'useFileTransport' => true, ], ], ];