2015-06-29 19:27:15 3637次浏览 1条回答 0 悬赏 0 金钱

在用gii生成model时修改了数据库后错误
A valid database connection is required to run this generator.
数据库配置如图

  • 回答于 2015-06-29 20:30 举报

    数据库配置!需要配置一下!

    return [
        'class' => 'yii\db\Connection',
        'dsn' => 'mysql:host=localhost;dbname=xxx',
        'username' => 'root',
        'password' => 'root',
        'charset' => 'utf8',
        'tablePrefix' => 'xx_',
    ];
    
    
    2 条回复
    回复于 2015-07-03 17:37 回复

    配置没有问题的 是gii的缓存问题

    回复于 2015-07-03 18:17 回复
您需要登录后才可以回答。登录 | 立即注册
善若善依
见习主管

善若善依

注册时间:2013-12-18
最后登录:2015-09-28
在线时长:22小时4分
  • 粉丝1
  • 金钱30
  • 威望0
  • 积分250

热门问题