Manual:MySQL
From MediaWiki.org
↑ Manual:Contents | MediaWiki database layout | MySQL |
The MySQL database engine is the most commonly-used database backend for MediaWiki. Since it is the relational database management system used by the Wikimedia Foundation wiki farm in its own websites, it is well-supported in MediaWiki.
Contents
Connecting to MySQL[edit | edit source]
mysql -u <wikiuser> -p
<translate> then enter your password, then, </translate>
USE <wikidb>
<translate>
Example[edit | edit source]
</translate>
aaron@escargot ~ $ mysql -u wikiuser -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 816 to server version: 5.5.20 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> USE wikidb Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql>
Installation[edit | edit source]
-
- Further information: Manual:Installing_MediaWiki#Create_a_database
Basically, if MySQL is installed, the installation script can create a database for you. Just supply the script with your mysql root password (by default blank).
![]() |
Leaving the MySQL root password blank can seriously compromise the security of the MediaWiki installation. You should modify the password if you haven't already. |
If you are installing MediaWiki on an ISP server, you might have to share a db with some other applications, which increases the risk of a conflict between database tables required by MediaWiki with pre-existing tables. To solve this problem you can instruct MediaWiki to use a table prefix, so that all tables of MediaWiki begin with this prefix. Alternatively, if your ISP allows, use different databases for each application that resides on the server.
Maintenance[edit | edit source]
Multiple maintenance scripts are included in the /maintenance/ directory of your MediaWiki installation. Some of these scripts are provided to refresh parts of the database as one-time operations.
Import database[edit | edit source]
- Further information: Manual:Importing XML dumps
Export database[edit | edit source]
- Further information: Manual:Backing up a wiki
See also[edit | edit source]
External links[edit | edit source]
![]() |
Engines: MySQL – Oracle – PostgreSQL – SQLite Technical documentation: Schema (tables) – API property associations – Field prefixes – Primary key storage in other fields – Wikimedia extension tables Configuration: Settings – Sharing Development: Access – Optimization – Policy – Updater – Extension schema updates – Patch file Core tables: archive – category – categorylinks – change_tag – config – externallinks – filearchive – hitcounter – image – imagelinks – interwiki – iwlinks – ipblocks – job – l10n_cache – langlinks – logging – log_search – msg_resource – msg_resource_links – module_deps – objectcache – oldimage – page – pagelinks – page_props – page_restrictions – protected_titles – querycache – querycachetwo – querycache_info – recentchanges – redirect – revision – searchindex – sites – site_stats – tag_summary – templatelinks – text – transcache – updatelog – uploadstash – user – user_former_groups – user_groups – user_newtalk – user_properties – valid_tag – watchlist |
---|
Language: | English • Deutsch • français • 日本語 • polski • português do Brasil • slovenčina |
---|