Skip to content

Instantly share code, notes, and snippets.

@trepmal
Created March 17, 2015 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trepmal/eab673549509a0722e52 to your computer and use it in GitHub Desktop.
Save trepmal/eab673549509a0722e52 to your computer and use it in GitHub Desktop.
<?php
/**
* HyperDB configuration file
*
* This file should be installed at ABSPATH/db-config.php
*
* $wpdb is an instance of the hyperdb class which extends the wpdb class.
*
* Fully documented config file:
* http://plugins.svn.wordpress.org/hyperdb/trunk/db-config.php
*/
/**
* Basic Master/Slave server setup
*/
$wpdb->add_database(array(
'host' => DB_HOST, // If port is other than 3306, use host:port.
'user' => DB_USER,
'password' => DB_PASSWORD,
'name' => DB_NAME,
));
$wpdb->add_database(array(
'host' => DB_SLAVE, // If port is other than 3306, use host:port.
'user' => DB_USER,
'password' => DB_PASSWORD,
'name' => DB_NAME,
'write' => 0,
'read' => 1,
'dataset' => 'global',
'timeout' => 0.2,
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment