Jump to content
 







Main menu
   


Navigation  



Main page
Get MediaWiki
Get extensions
Tech blog
Contribute
 




Support  



User help
FAQ
Technical manual
Support desk
Communication
 




Development  



Developer portal
Code statistics
 




mediawiki.org  



Community portal
Recent changes
Translate content
Random page
Village pump
Sandbox
 




In other languages  



Afrikaans
العربية
Azərbaycanca
Беларуская
Български

Bosanski
Català
کوردی
Čeština
Dansk
Deutsch
Ελληνικά
English
Esperanto
Español
Eesti
Euskara
فارسی
Suomi
Français
Gaeilge
Galego
עברית
ि
Hrvatski
Magyar
Հայերեն
Bahasa Indonesia
Italiano

Taqbaylit
Қазақша

Kurdî
Кыргызча
Lietuvių
Latviešu
Malagasy
Македонски

Монгол
Bahasa Melayu

Nederlands
Norsk bokmål
Polski
Português
Română
Русский

Simple English
Slovenčina
Slovenščina
Shqip
Српски / srpski
Svenska
ி

Türkmençe
Türkçe
Українська
Oʻzbekcha / ўзбекча
Tiếng Vit
Winaray



 

Edit links
 







Search  









English
 


















Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



Beginning
 


1 Connecting to MySQL  



1.1  Example  





1.2  Installation  







2 Maintenance  





3 Import database  





4 Export database  





5 See also  





6 External links  














Manual:MySQL










Manual
Discussion
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Create a book
Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
Wikibooks
Wikipedia
Wikiversity
 
















From mediawiki.org
 


  • English
  • Nederlands
  • Türkçe
  • Yorùbá
  • español
  • français
  • italiano
  • lietuvių
  • polski
  • português
  • português do Brasil
  • slovenčina
  • čeština
  • русский
  • अवधी
  • 中文
  • 日本語
  • 한국어
  • Manual:Contents MediaWiki database layout MySQL

    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

     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

    $ mysql -u root -p my_wiki
    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.
    
    mysql>.
    

    Installation

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

    Warning 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

    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

    For further information, see Manual:Importing XML dumps

    Export database

    For further information, see Manual:Backing up a wiki

    See also

    External links


    Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:MySQL&oldid=6456760"

    Category: 
    Database
     



    This page was last edited on 7 April 2024, at 03:48.

    Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. See Terms of Use for details.



    Privacy policy

    About mediawiki.org

    Disclaimers

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki