Opas:$wgDBprefix

From mediawiki.org
This page is a translated version of the page Manual:$wgDBprefix and the translation is 93% complete.
Database settings: $wgDBprefix
Tietokantataulun etuliitteen nimi.
Introduced in version:1.4.0
Removed in version:still in use
Allowed values:(merkkijono)
Default value:''

Tiedot

Tietokantataulun etuliitteen nimi. Tämän tulisi olla aakkosnumeerinen, eikä sisältää välilyöntejä tai väliviivoja, ja sen tulisi olla "_". Jos sinulla on pääsy vain yhteen tietokantaan ja haluat asentaa useamman kuin yhden MediaWikin version tai jos sinulla on muita sovelluksia, jotka käyttävät myös tietokantaa, voit antaa taulukkojen nimille yksilöllisen etuliitteen, joka estää kaikki nimien ristiriidat tai sekaannukset.

Esimerkiksi, jos käytät etuliitettä 'wiki_', tietokantataulun 'page' nimeksi tulee 'wiki_page'.

Sinun on määritettävä tämä alkuasetusten määrityksen yhteydessä tai muutettava taulukoiden nimet manuaalisesti myöhemmin. Tämän asetuksen muuttaminen ei päivitä tietokantataulujen nimiä automaattisesti.

Tätä asetusta EI käytetä, jos tietokantasi on PostgreSQL.[1]

Yhteinen arvo

Many installers set the database table prefix "$wgDBprefix" to "mw_" by default.

[2][3][4]

Huomio! Huomio:
  • Do not change $wgDBmwschema after Setup.php has been included. Note: Setup.php initializes various paths, includes some common files, starts sessions, and performs various other setup tasks for a request. It is not related to the installation or setup of MediaWiki.
  • Only files in includes/db/ should use $wgDBmwschema, while everything else should use the dbSchema() method provided by the Wikimedia\Rdbms\IDatabase interface or extract it from the getDomainId() method in either the Wikimedia\Rdbms\ILoadBalancer or the Wikimedia\Rdbms\ILBFactory interface. The DatabaseDomain class can extract such components from a database domain ID.
  • If you configure $wgDBservers or $wgLBFactoryConf, you still need to define $wgDBname, $wgDBmwschema (if applicable for the DB type), and $wgDBprefix (if applicable for the DB type). The combination of $wgDBname, $wgDBmwschema, and $wgDBprefix define the current wiki's database domain. This is also called the local database domain. The 'dbname' and 'tablePrefix' settings in $wgDBservers and $wgLBFactoryConf only define the default DB/prefix when a connection is requested with DatabaseDomain::newUnspecified()->getId() (the empty string) as the database domain, e.g. wfGetDB( DB_REPLICA, [], '' ). Note that functions calls like wfGetDB( DB_REPLICA ), which simply omit the database domain, are assumed to refer to the local database domain.

Lähteet


Katso myös