数据库连接问题


Yii db connection issue

我得到这个错误信息:

活动记录类的"Permissionactions"表数据库中找不到"Permissionactions"。

  /var/www/html/YII/framework/db/ar/CActiveRecord.php(2310)
     private $_model;
     /**
      * Constructor.
     * @param CActiveRecord $model the model instance
      */
     public function __construct($model)
     {
        $this->_model=$model;
        $tableName=$model->tableName();
         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
            throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
                 array('{class}'=>get_class($model),'{table}'=>$tableName)));
         if($table->primaryKey===null)
         {
             $table->primaryKey=$model->primaryKey();
             if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
                 $table->columns[$table->primaryKey]->isPrimaryKey=true;
            elseif(is_array($table->primaryKey))
           {
               foreach($table->primaryKey as $name)
                {
                     if(isset($table->columns[$name]))
                        $table->columns[$name]->isPrimaryKey=true;
在我的数据库中没有任何名为table的Permissionactions。这是main.php连接:
'db' => array(
            'connectionString' => 'mysql:host=xxxxxxxxx;dbname=xxxxx',
            'emulatePrepare' => true,
            'username' => 'xxxxxxxx',
            'password' => 'xxxxxxxxxxx',
            'charset' => 'utf8',
        ),
         'dbpermissions' => array(
            'connectionString' => "mysql:host=xxxxxxxx;dbname=xxxxx",
            'emulatePrepare' => true,
            'username' => 'xxxxxxxx',
            'password' => 'xxxxxxxxxxxxxxx',
            'charset' => 'utf8',
            'class' => 'CDbConnection'
        ),

你知道我为什么会收到这个吗?

更新:这是控制器:

class MainController extends Controller {
    public $model;
    public function init(){
        $this->model = Permissionactions::model();
    }
...

和Permissionsactions类(model):

class Permissionactions extends ActiveRecord{
    private $connection_permission; 
    //private $connection_invetory;
    /**
     * @see db connections from config/main.php
     */
    public function __construct(){
        $this->connection_permission =  Yii::app()->dbpermissions;
    }
    public static function model($className=__CLASS__){
        return parent::model($className);
    }
....

在我的本地主机上它工作。但是现在我把它放到服务器上它显示了这个错误

使用编辑器/IDE函数搜索代码在文件中搜索/在项目中搜索并找到字符串

Permissionactions

提供有关您的Issue和配置的更多信息