请问下1.1有实现数据库主从吗?

请问下1.1有实现数据库主从吗?

手册里好像没有提到这个问题。

http://www.yiiframework.com/forum/index.php?/topic/10865-db-read-write-splitting/

//日志组件的配置

‘db’=>array(

‘class’=>‘CDbConnectionExt’,

‘emulatePrepare’ => true,

‘charset’ => ‘utf8’,

//主数据库配置

‘connectionString’ => ‘mysql:host=localhost;dbname=a;port=3306’,

‘username’ => ‘root’,

‘password’ => ‘11’,

//从数据库配置

‘slaveConfig’=>array(

array(‘connectionString’=>‘mysql:host=localhost;dbname=a;port=3306’,‘username’=>‘root’,‘password’=>‘11’,),

array(‘connectionString’=>‘mysql:host=localhost;dbname=a;port=3306’,‘username’=>‘root’,‘password’=>‘11’,),

array(‘connectionString’=>‘mysql:host=localhost;dbname=a;port=3306’,‘username’=>‘root’,‘password’=>‘11’,),

array(‘connectionString’=>‘mysql:host=localhost;dbname=a;port=3306’,‘username’=>‘root’,‘password’=>‘11’,),

),

);

0

:lol: 太长了 那个扩展 :D

我的搞定了,比那个简单多了。

等项目上线了 大家可以去下载

:rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes: