How to optimize wordpress with a Mysql replication

From EN Ikoula wiki
Revision as of 16:24, 1 October 2021 by Cbrochot1072d (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽

en:How to optimize wordpress with a Mysql replication he:מיטוב wordpress עם העתק Mysql ru:Как оптимизировать wordpress с Mysql репликации ja:ワードプレスの Mysql のレプリケーションを最適化する方法 ar:كيفية تحسين وورد مع تكرار الخلية zh:如何优化 wordpress 与 Mysql 复制 ro:Cum să optimizaţi wordpress cu o replicare Mysql pl:Jak zoptymalizować wordpress z replikacji Mysql de:Wie Wordpress mit einem Mysql-Replikation zu optimieren nl:Hoe te optimaliseren wordpress met een Mysql replicatie it:Come ottimizzare wordpress con una replica di Mysql pt:Como otimizar wordpress com uma replicação do Mysql es:Cómo optimizar wordpress con una replicación Mysql fr:Comment optimiser wordpress avec une replication Mysql

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


The installation will be done command-line ssh but very well be from your local pc and FTP are sent.


1. Since the home folder, download then unzip this file :

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


2. Copy the default config in the root of the site file and edit :

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


3. Locate the following passage in the file, and replace DB_HOST by DB_SLAVE_ 1

$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 the file wp - config.php

define('DB_SLAVE_1', 'IP_du_serveur_mysql_slave');


5. Finally copy this file to enable all.

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



[[:fr:category:Serveur dédi��]]


You are not allowed to post comments.