“如何优化 wordpress 与 Mysql 复制”的版本间的差异
Jump to navigation
Jump to search
第1行: | 第1行: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<br /> | <br /> | ||
这篇文章是从由软件进行自动翻译。你可以[[:fr:Comment optimiser wordpress avec une replication Mysql|看到这篇文章的源代码]]<br /><span data-translate="fr"></span> | 这篇文章是从由软件进行自动翻译。你可以[[:fr:Comment optimiser wordpress avec une replication Mysql|看到这篇文章的源代码]]<br /><span data-translate="fr"></span> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
第25行: | 第19行: | ||
− | + | 在这篇文章,将 SSH 命令行中进行安装,但它很可能会从您的本地 PC 做和由 FTP 发送。 | |
− | 1.自回家的文件夹,下载,然后将此文件解压 | + | 1.自回家的文件夹,下载,然后将此文件解压 | _._。 .复制站点的根目录中的默认配置和编辑 | _._。 .在文件中查找,下列短文,取代 DB_SLAVE_ db_host 较 | _._。 .在该文件中添加这行 wp-config.php | _._。 .最后将复制此文件,以在所有激活。 : |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cd ~; wget http://downloads.wordpress.org/plugin/hyperdb.zip | cd ~; wget http://downloads.wordpress.org/plugin/hyperdb.zip | ||
第35行: | 第29行: | ||
</syntaxhighlight><br /> | </syntaxhighlight><br /> | ||
− | + | 2找到页面上致力于我们的 Wordpress 报价 : | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cp ~/hyperdb/db-config.php /var/www/ | cp ~/hyperdb/db-config.php /var/www/ | ||
第41行: | 第35行: | ||
</syntaxhighlight> <br /> | </syntaxhighlight> <br /> | ||
− | + | 31 | |
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
$wpdb->add_database(array( | $wpdb->add_database(array( | ||
第55行: | 第49行: | ||
</syntaxhighlight> <br /> | </syntaxhighlight> <br /> | ||
− | 4 | + | 4 |
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
define('DB_SLAVE_1', 'IP_du_serveur_mysql_slave'); | define('DB_SLAVE_1', 'IP_du_serveur_mysql_slave'); | ||
</syntaxhighlight> <br /> | </syntaxhighlight> <br /> | ||
− | 5 | + | 5 |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cp ~/hyperdb/db.php /var/www/wp-content/ | cp ~/hyperdb/db.php /var/www/wp-content/ | ||
第69行: | 第63行: | ||
+ | [https://express.ikoula.com/fr/hebergement-wordpress Ikoula 网站]. | ||
[[Category:专用的服务器]] | [[Category:专用的服务器]] | ||
[[Category:Linux]] | [[Category:Linux]] | ||
+ | [[Category:WordPress]] | ||
<br /> | <br /> | ||
<comments /> | <comments /> |
2016年10月13日 (四) 14:57的版本
这篇文章是从由软件进行自动翻译。你可以看到这篇文章的源代码
在这篇文章,将 SSH 命令行中进行安装,但它很可能会从您的本地 PC 做和由 FTP 发送。
1.自回家的文件夹,下载,然后将此文件解压 | _._。 .复制站点的根目录中的默认配置和编辑 | _._。 .在文件中查找,下列短文,取代 DB_SLAVE_ db_host 较 | _._。 .在该文件中添加这行 wp-config.php | _._。 .最后将复制此文件,以在所有激活。 :
cd ~; wget http://downloads.wordpress.org/plugin/hyperdb.zip
sudo apt-get install zip
unzip hyperdb.zip
2找到页面上致力于我们的 Wordpress 报价 :
cp ~/hyperdb/db-config.php /var/www/
vi /var/www/db-config.php
31
$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
define('DB_SLAVE_1', 'IP_du_serveur_mysql_slave');
5
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
Ikoula 网站.
开启评论自动刷新