Yii Framework: The table for active record class cannot be found in the database

后端 未结 3 1197
暖寄归人
暖寄归人 2021-01-19 14:51

I\'m hoping the hivemind has some more suggestions on dealing with this error from Yii Framework. The exact error, specific to our setup is:

相关标签:
3条回答
  • 2021-01-19 15:33

    I was facing similar error with MySQL. In my case the problem was that I had made a mistake in granting the rights for the user. Running MySQL client I got a proper "command denied message", but from Yii perspective it looked like the tables did not exist at all.

    The solution was to grant the rights properly:

    grant all on yiiapp.* to 'yii'@'localhost' identified by 'yii';

    0 讨论(0)
  • 2021-01-19 15:36

    It turns out the data was not imported to the named database. Instead it was imported to the user's database. In this case 'postgres'. The fix in this case is to re-import the data to the correct location, or change the Yii config (our decision). New connection settings:

    'db'=>array('connectionString' => 'pgsql:dbname=postgres', 'emulatePrepare' => true, 'username' => 'postgres','password' => '',)
    
    0 讨论(0)
  • 2021-01-19 15:36

    Yii caches db metadata, probably that is the issue? Try to clear your metadata cache or disable cache at all.

    The /wwwroot/assets folder usually contains those cache files.

    Check also that you haven't run out of space on your device (disk).

    Source: Quoting one of the comments to this Question - Yii Framework: The table for active record class cannot be found in the database

    0 讨论(0)
提交回复
热议问题