我使用Yii框架创建了一个网站,我收到错误“无法在数据库中找到活动记录类的表。”。我已经确认,该表确实存在于数据库中。我还验证了数据库中的表名与模型类中的表名具有相同的大小写。
此外,此错误随机出现。还有其他人遇到过这个问题吗?谢谢你的时间。
更新 型号代码:
class User extends CWIActiveRecord
{
public $confirmEmail;
public $confirmPassword;
public $currentPassword;
public $newPassword;
public $newPasswordRepeat;
private $_identity;
public function tableName()
{
return "cwi_user";
}
public static function model($className=__CLASS__)
{
return parent::model($className);
}
public function attributeLabels()
{
return array(
'id' => 'ID',
'email' => 'Email',
'password' => 'Password',
'isSubscribed' => 'Receive updates about investment, special offers and updates on '. Yii::app()->name,
'verificationToken' => 'Verification Token',
'status' => 'Status',
'accountType' => 'Account Type',
'createdBy' => 'Created By',
'lastModifiedBy' => 'Last Modified By',
'createdDate' => 'Created Date',
'lastModifiedDate' => 'Last Modified Date',
'createdIp' => 'Created Ip',
'lastModifiedIp' => 'Last Modified Ip',
'currentPassword' => 'Existing Password',
'newPassword' => 'New Password',
'newPasswordRepeat' => 'Confirm Password',
);
}
}
数据库配置:
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=test',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
答案 0 :(得分:0)
我有同样的问题.mysql的temp dir可能已满,而且有些查询需要将大量数据写入临时空间,然后错误thrown.check“df -h”和clear / tmp,可能生效