我读了警予文档和下面的代码应该工作;
好了,它不。 :))
db是主数据库
DB1和DB2是辅助数据库
这里有什么问题?
该网站是在线,在www.linkbook.co
,它不能连接到任何数据库
'db' => array(
'connectionString' => 'mysql:host=localhost;dbname=linkbookco',
'emulatePrepare' => true,
'username' => 'user',
'password' => 'password',
'charset' => 'utf8',
'tablePrefix' => '',
),
'db1' => array(
'connectionString' => 'mysql:host=localhost;dbname=linkbookco1',
'username' => 'user',
'password' => 'password',
'charset' => 'utf8',
'tablePrefix' => '',
'class' => 'CDbConnection' // DO NOT FORGET THIS!
),
'db2' => array(
'connectionString' => 'mysql:host=localhost;dbname=linkbookco2',
'username' => 'user',
'password' => 'password',
'charset' => 'utf8',
'tablePrefix' => '',
'class' => 'CDbConnection' // DO NOT FORGET THIS!
),