Manual:MySQL

From MediaWiki.org
Jump to: navigation, search
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

[edit] Connecting to MySQL mysql

mysql -u <wikiuser> -p

then enter your password, then,

 USE <wikidb>

[edit] Example

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

[edit] Installation

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).

Warning Warning: 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.
Note: If you are installing MediaWiki on an ISP server, you might have to share a db with some other applications, which increases the size of a conflict between database tables required by MediaWiki with pre-existing tables. If your ISP allows, use different databases or different database users for each application that resides on the server.

[edit] Maintenance

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.

[edit] Import database

Further information: Manual:Importing XML dumps

[edit] Export database

Further information: Manual:Backing up a wiki

[edit] External links

Databases Engines: MySQLPostgreSQLSQLiteIBM DB2
Technical documentation: Schema (tables) – Access
Language: English  • Français • Polski • Slovenčina
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox