Skip to content

Use databases

Releasev0.35.0 · cfeceb67

The development environment comes with the ability to create wikis using sqlite, mysql or postgres.

If you follow the first setup guide you will create a default wiki using a mysql service.

PHPMyAdmin & Adminer are web interfaces for various database backends.

You can easily run these as part of the development environment.

mw dev phpmyadmin create
mw dev adminer create

You can choose to add a mysql replica at any time. Replication will be handled automatically (but may take some time to catch up if you have already performed lots of actions).

mw dev mysql-replica create

See MySQL dumps for import and export commands, including terminal handling and restoring MediaWiki data.

Use the bundled client or the dump commands without exposing a port. To connect a host database tool on port 3306:

Terminal window
mw dev env set MYSQL_PORT_3306 3306
mw dev mysql create --force-recreate

Choose an unused host port. The HTTP gateway’s PORT setting is separate.


Read this guide offline with mw help guides dev databases.

Adapted from MediaWiki.org under CC BY-SA 4.0; see the linked page history for contributors.

Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.