Jump to: navigation, search
This page is a translated version of the page Manual:MySQL and the translation is 0% complete.

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎日本語 • ‎lietuvių • ‎polski • ‎português do Brasil • ‎slovenčina
Manual:ContentsManual:Contents MediaWiki database layoutManual:Database layout MySQL/fr

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.

Connecting to MySQL

 mysql -u wikiuser -p wikidb

Change wikiuser and wikidb to the username and database name for your wiki ($wgDBuser and $wgDBname). When prompted, enter your password.


$ mysql -u root -p wikidb
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 150
Server version: 5.6.24-0ubuntu2 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.



Further information: Manual:Installing MediaWiki#Create a databaseManual: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).

Avertissement Avertissement :

Note Note : 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.


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

Further information: Manual:Importing XML dumpsManual:Importing XML dumps

Export database

Further information: Manual:Backing up a wikiManual:Backing up a wiki

See also

External links

DatabasesManual:Database layout Engines: MySQLManual:MySQLOracleManual:OraclePostgreSQLManual:PostgreSQLSQLiteManual:SQLite
Documentation technique: SchemaManual:Database layout (tablesCategory:MediaWiki database tables) – API property associationsAPI:Database field and API property associationsField prefixesDatabase field prefixesPrimary key storage in other fieldsManual:Primary key storage in other fieldsWikimedia extension tablesCategory:Wikimedia extension database tables
Configuration: SettingsManual:Configuration_settings#Database_settingsPartageManual:Shared database
Développement: AccessManual:Database accessOptimizationDatabase optimizationPolitiqueDevelopment policy#Database_patchesUpdaterManual:DatabaseUpdater.phpExtension schema updatesManual:Hooks/LoadExtensionSchemaUpdatesPatch fileManual:SQL patch file
Core tables: archivecategorycategorylinkschange_tagconfigexternallinksfilearchivehitcounterimageimagelinksinterwikiiwlinksipblocksjobl10n_cachelanglinkslogginglog_searchmsg_resourcemsg_resource_linksmodule_depsobjectcacheoldimagepagepagelinkspage_propspage_restrictionsprotected_titlesquerycachequerycachetwoquerycache_inforecentchangesredirectrevisionsearchindexsitessite_statstag_summarytemplatelinkstexttranscacheupdateloguploadstashuseruser_former_groupsuser_groupsuser_newtalkuser_propertiesvalid_tagwatchlist