How to optimize wordpress with Mysql replication

From EN Ikoula wiki
Revision as of 12:52, 27 December 2016 by Ikbot (talk | contribs) (Created page with "<br /> This article has been created by an automatic translation software. You can view the article source here.<b...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽


This article has been created by an automatic translation software. You can view the article source here.







In this article, the installation will be done via SSH command line, but it may very well on your local PC (Notepad) and then be sent via FTP.

1. In the home directory, download and suits:

cd ~; wget http://downloads.wordpress.org/plugin/hyperdb.zip
sudo apt-get install zip
unzip hyperdb.zip


2. Copy the default configuration file to the root of the site edit this:

cp ~/hyperdb/db-config.php /var/www/
vi /var/www/db-config.php


3. Search in the file, the following passage and replace by DB_SLAVE_ DB_HOST1

$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,
        'write'    => 0,
        'read'     => 1,
        'dataset'  => 'global',
        'timeout'  => 0.2,
));


4. Add this line in URwp-config.php

define('DB_SLAVE_1', 'IP_du_serveur_mysql_slave');


5. Finally: Copy the file.

cp ~/hyperdb/db.php /var/www/wp-content/
chmod a-w /var/www/wp-content/db.php
chown -R www-data:www-data /var/www/wp-content/db.php
chown -R www-data:www-data /var/www/db-config.php

WordPress offers needed? Check the site of Ikoula. Ikoula Wordpress.


You are not allowed to post comments.