MediaWiki-Docker/Configuration recipes/Alternative databases

Alternative databases
The default configuration uses SQLite for the database backend, but you can use MySQL (with replication or without) or Postgres instead.

MariaDB (database replication)
This is the configuration recipe that is most like Wikimedia production.

These instruction assume a new installation (no LocalSettings.php).

To install MediaWiki, open a bash shell in the container:

In this bash shell, install MediaWiki with the following command:

After installing, add these snippets so that MediaWiki knows to read from the replica but write to the main database.



Simulating replication lag
On the replica database (e.g. ): where  is the number of seconds to delay. Set this to  to remove the lag.

You can check the amount of lag by running  and looking for the row.

MariaDB (single database server)
These instruction assume a new installation (no LocalSettings.php).



To install MediaWiki, open a bash shell in the container:

In this bash shell, install MediaWiki with the following command:

Postgres (single database server)
These instruction assume a new installation (no LocalSettings.php).



To install the MediaWiki database tables, use: