Manual:$wgDBmwschema

From Linux Web Expert

<translate> Database settings</translate>: $wgDBmwschema
Schema that stores the MediaWiki tables in.
<translate> Introduced in version:</translate>1.8.0
<translate> Removed in version:</translate><translate> still in use</translate>
<translate> Allowed values:</translate>(string)
<translate> Default value:</translate>null (1.23+)
'mediawiki' (1.8-1.22)

Details

Schema for mediawiki tables. It was originally only used if your backend database was Postgres/MSSQL. Since MediaWiki 1.31 it affects other database types too. This indicates what schema the main mediawiki tables live in, and is roughly equivalent to the way that $wgDBprefix is used by MySQL.

The installer of old MediaWiki versions were setting this to 'mediawiki' in LocalSettings.php directly, even for MySQL databases, which may cause errors when upgrading. If you get errors when upgrading to MediaWiki 1.31 or later and you're not using Postgres/MSSQL as database backend, remove this setting from LocalSettings.php.

File:OOjs UI icon alert-destructive.svg <translate> Caution:</translate>
  • <translate> Do not change <tvar name=1>$wgDBmwschema</tvar> after <tvar name=2>Setup.php </tvar> has been included.</translate> <translate> Note:</translate> <translate> <tvar name=1>Setup.php </tvar> initializes various paths, includes some common files, starts sessions, and performs various other setup tasks for a request.</translate> <translate> It is not related to the installation or setup of MediaWiki.</translate>
  • <translate> Only files in <tvar name=1>includes/db/</tvar> should use <tvar name=2>$wgDBmwschema</tvar>, while everything else should use the <tvar name=3>dbSchema()</tvar> method provided by the <tvar name=4>Wikimedia\Rdbms\IDatabase</tvar> interface or extract it from the <tvar name=5>getDomainId()</tvar> method in either the <tvar name=6>Wikimedia\Rdbms\ILoadBalancer</tvar> or the <tvar name=7>Wikimedia\Rdbms\ILBFactory</tvar> interface.</translate> <translate> The <tvar name=1>DatabaseDomain</tvar> class can extract such components from a database domain ID.</translate>
  • <translate> If you configure <tvar name=1>$wgDBservers</tvar> or <tvar name=2>$wgLBFactoryConf</tvar>, you still need to define <tvar name=3>$wgDBname</tvar>, <tvar name=4>$wgDBmwschema</tvar> (if applicable for the DB type), and <tvar name=5>$wgDBprefix</tvar> (if applicable for the DB type).</translate> <translate> The combination of <tvar name=1>$wgDBname</tvar>, <tvar name=2>$wgDBmwschema</tvar>, and <tvar name=3>$wgDBprefix</tvar> define the current wiki's database domain.</translate> <translate> This is also called the local database domain.</translate> <translate> The '<tvar name=1>dbname</tvar>' and '<tvar name=2>tablePrefix</tvar>' settings in <tvar name=3>$wgDBservers</tvar> and <tvar name=4>$wgLBFactoryConf</tvar> only define the default DB/prefix when a connection is requested with <tvar name=5>DatabaseDomain::newUnspecified()->getId()</tvar> (the empty string) as the database domain, e.g. <tvar name=6>wfGetDB( DB_REPLICA, [], '' )</tvar>.</translate> <translate> Note that functions calls like <tvar name=1>wfGetDB( DB_REPLICA )</tvar>, which simply omit the database domain, are assumed to refer to the local database domain.</translate>
File:OOjs UI icon notice-destructive.svg <translate> Warning:</translate> If you change this setting, you should probably create a new user (and change $wgDBuser as well), because the configuration script sets the user's default path to include the schema.