yii1.1版本的 mysql主从数据库配置 我用的是AR操作的数据库 怎么实现读写分离 [ 求助交流 ]
yii1.1版本的 mysql主从数据库配置 我用的是AR操作的数据库 怎么实现读写分离 我这图就是yii配置文件里 配的数据库
共 3 条回复
-
我记得是直接用config来实现的,不需要在AR层做修改。
共 1 条回复我在配置文件里配的 但是不起作用,并且程序访问不到数据库了
'db'=>array( 'class'=>'DbConnectionMan',//Specify it,instead of CDbConnection,other options is same as CDbConnection 'connectionString' => 'mysql:host=192.168.207.132:3306;dbname=eyisheng', 'emulatePrepare' => true, 'username' => 'root', 'password' => '123456', 'charset' => 'utf8', 'tablePrefix' => 'dv_', 'enableSlave'=>true,//Read write splitting function is swithable.You can specify this value to false to disable it. 'slaves'=>array(//slave connection config is same as CDbConnection array( 'connectionString'=>'mysql:host=192.168.207.133:3306;dbname=eyisheng', 'username'=>'root', 'password'=>'123456', 'tablePrefix' => 'dv_', ) ), ),
-
xiaoniqiu2015 回复于 2016-04-04 10:30 举报
截图看一下呗
-
'db'=>array( 'class'=>'DbConnectionMan',//Specify it,instead of CDbConnection,other options is same as CDbConnection 'connectionString' => 'mysql:host=192.168.207.132:3306;dbname=eyisheng', 'emulatePrepare' => true, 'username' => 'root', 'password' => '123456', 'charset' => 'utf8', 'tablePrefix' => 'dv_', 'enableSlave'=>true,//Read write splitting function is swithable.You can specify this value to false to disable it. 'slaves'=>array(//slave connection config is same as CDbConnection array( 'connectionString'=>'mysql:host=192.168.207.133:3306;dbname=eyisheng', 'username'=>'root', 'password'=>'123456', 'tablePrefix' => 'dv_', ) ), ),
共 1 条回复
yg
注册时间:2016-04-01
最后登录:2016-04-12
在线时长:1小时30分
最后登录:2016-04-12
在线时长:1小时30分
- 粉丝2
- 金钱40
- 威望0
- 积分50