Manual:MySQL - MediaWiki (2024)

Manual:ContentsMediaWiki database layoutMySQL

The MySQL database engine is the most commonly-used database backends for MediaWiki.Since MySQL used to be the relational database management system used by the Wikimedia Foundation websites, it is well-supported in MediaWiki.Much of the advice for MySQL and for MariaDB apply to each other.

See Compatibility#Database for a list of supported versions.

Connecting to MySQL[edit]

 mysql -u wikiuser -p my_wiki

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

Example[edit]

$ mysql -u root -p my_wikiEnter password: Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with; or \g.Your MySQL connection id is 150Server version: 5.6.24-0ubuntu2 (Ubuntu)...Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>.

Installation[edit]

For further information, see 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).

Manual:MySQL - MediaWiki (1) Warning: Leaving the 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]

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]

For further information, see Manual:Importing XML dumps

Export database[edit]

For further information, see Manual:Backing up a wiki

See also[edit]

External links[edit]

Engines
Current
Former
Technical documentation
Configuration
Development
Core tables
Current
Former
Manual:MySQL - MediaWiki (2024)
Top Articles
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 5747

Rating: 4.3 / 5 (64 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.