Manual:$wgDBTableOptions/zh

From Linux Web Expert

Revision as of 07:51, 4 December 2023 by 163.13.9.60 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<translate> MySQL-specific</translate>: $wgDBTableOptions
在安装及更新过程中使用的MySQL表选项。
<translate> Introduced in version:</translate>1.10.0 (r21466)
<translate> Removed in version:</translate><translate> still in use</translate>
<translate> Allowed values:</translate>(字符串)
<translate> Default value:</translate>参见下方

详情

MySQL table options to use during installation or update. $wgDBTableOptions will be set in the LocalSettings.php file generated by the installer. You can choose one of the following options resulting in the according values:

MySQL binary
ENGINE=InnoDB, DEFAULT CHARSET=binary
MySQL UTF-8
ENGINE=InnoDB, DEFAULT CHARSET=utf8
No matter which value is selected here, MediaWiki internally always produces data in UTF-8 encoding to be saved in the database. Thus a conversion is never needed. Since binary charsets prevent MySQL from doing charset conversions, which otherwise unnecessarily might take place, the recommended setting is the default setting.
The keyword "TYPE" was deprecated and is no longer supported by current MySQL versions (≥5.5). If you then use the "TYPE" keyword anyway, you will get an error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "TYPE=InnoDB"". The solution is to use the keyword "ENGINE" instead of "TYPE".
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.18</tvar> is unsupported version</translate>">
<translate> ≤</translate> 1.18
MediaWiki版本:

The following setting is no longer available in current versions due to dropped MySQL 4 support:

MySQL 4.0 backwards-compatible UTF-8
TYPE=InnoDB

默认值

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.32
<translate> MediaWiki version:</translate>
$wgDBTableOptions = 'ENGINE=InnoDB, DEFAULT CHARSET=binary';
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.31</tvar> is unsupported version</translate>">
1.13 – 1.31
<translate> MediaWiki versions:</translate>
$wgDBTableOptions = 'ENGINE=InnoDB';
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.12</tvar> is unsupported version</translate>">
1.10 – 1.12
<translate> MediaWiki versions:</translate>
$wgDBTableOptions = 'TYPE=InnoDB';