[HyperDB] Using mysql replication

Wouter Westendorp Wouter.Westendorp at ilsemedia.nl
Tue Aug 5 15:42:40 GMT 2008


Hello,
 
We're trying to set up master / slave replication using HyperDB where
the reads should go to the slave and writes to the master.
 
Here it fails. Since HyperDB does a SET NAMES UTF-8 query in the
constructor, it connects to the master, which means all following
queries are sent to the master too.
 
We use the following settings in db-settings.php:
 
add_db_server('global', 0, '', 0, true, '192.168.210.4:3306',
'192.168.210.4:3306', 'xx', 'xxx', 'xxx'); // master
add_db_server('global', 0, '', 1, false, '192.168.210.7:3306',
'192.168.210.7:3306', 'xx', 'xxx', 'xxx'); // slave
 
Does anyone have experience with this kind of set up?
 
If I comment the SET NAMES query it works fine.
 
Thanks in advance,
 
    Wouter Westendorp


More information about the HyperDB mailing list