在数据库配置中进行如下配置即可:推荐学习:yii框架<?phpreturn [class => yiidbConnection,dsn => mysql:host=127.0.0.1; dbname=ohmycto;