how to set database connection priority and master master write permission
-
Hi there,
thanks for the great plugin it works like a charm but i am little bit confuse to configure it please guide me how do i implement it.
suppose i have 1 master database 2 database replica.
if i hit my wp-admin then i have the permission to write on master and read from master
priority master(1) replica(2) replica(3)if a normal user comes to website then it will always read from replica and if there is any update query like get_post_meta then it will update master
priority replica(1) replica(2) master (3)currently i am trying to implement on my local machine so here is my configration
$wpdb->add_database(array( 'host' => localhost, // If port is other than 3306, use host:port. 'user' => root, 'password' => '', 'name' => fresh, 'write' => 1, 'read' => 1, )); /** * This adds the same server again, only this time it is configured as a slave. * The last three parameters are set to the defaults but are shown for clarity. */ $wpdb->add_database(array( 'host' => localhost, // If port is other than 3306, use host:port. 'user' => root, 'password' => '', 'name' => test1, 'write' => 0, 'read' => 1, 'dataset' => 'global', 'timeout' => 0.2, ));
Sorry for my bed english
Thanks
n3RDY
- The topic ‘how to set database connection priority and master master write permission’ is closed to new replies.