Manual:$wgDBserver

This page is a translated version of the page Manual:$wgDBserver and the translation is 86% complete.
データベースの設定: $wgDBserver
データベース サーバーのホスト名または IP アドレス。
導入されたバージョン:pre 1.1.0
除去されたバージョン:使用中
許容される値:(文字列)
既定値:'localhost'

詳細

データベースのホスト名または IP アドレスです。LocalSettings.php に記述されています。

MySQL を標準以外のポートで使用している場合、「ホスト名:ポート」の構文を使用できます。例: $wgDBserver = '127.0.0.1:3308';。 ホスト名として localhost を指定した場合は、ポート番号の指定に効果がないことにご注意ください。これは、MySQL が代わりにソケットで接続するためです。 MySQL サーバーが同一のサーバー上にあり、かつ標準以外の場所へソケットで接続したい場合は、「localhost:ソケット」の構文を使用できます。例: $wgDBserver = 'localhost:/var/run/mysql/mysql.sock';

IP アドレスを使用することで、ウィキへの個別の接続のたびに生じる DNS ルックアップのオーバーヘッドを回避できる場合があります。 $wgDBserver = '000.000.000.000';$wgDBserver = "wiki.example.org"; よりも高速です。
$wgDBport は、PostgreSQL を使用する構成でのみ使用されます。
On Windows, having MySQL as the backend, some users report that using localhost for the server name instead of 127.0.0.1 increase the time to connect to the database a lot. So, in windows, it's recommended to use 127.0.0.1 instead of localhost if MySQL is on the same machine. See this forum thread.

関連項目

  • $wgDBservers - for multiple-server (primary/replica) setups or users of custom certificates for SSL encryption where $wgDBssl does not work.