MariaDB Installation
Last modified by Thomas Mortagne on 2023/01/02
Compatibility Considerations
See Database support strategy for the supported versions.
XWiki expects the database to use utf8 or utf8mb4 encoding with collation *_bin and it's highly recommended to use utf8mb4 (and utf8mb4_bin).
MariaDB versions older than 10.2
If you use utf8mb4 encoding you won't be able to use version of MariaDB older than 10.2 out of the box because of a limitation in the default maximum size of the keys and the default row format.
Installation Steps
In general you should follow the instructions for installing MySQL since MariaDB is supposed to be a drop-in replacement for MySQL.
Here are the differences with the MySQL installation:
- Download and install MariaDB, using a supported version
- You need to have the MariaDB JDBC Driver JAR (named mariadb-java-client-*.jar) installed in XWiki's WAR file. If this file isn't present in XWiki's WEB-INF/lib directory you'll need to download it and copy it there. You can download it from the MariaDB Connector/J Driver page or directly from the Maven Central Repository.
- You need to tell XWiki to use MariaDB. To do this, edit the WEB-INF/hibernate.cfg.xml file where you have expanded the XWiki WAR file and replace the matching properties with the following ones:<property name="connection.url">jdbc:mariadb://localhost/xwiki?useSSL=false</property>
<property name="connection.username">xwiki</property>
<property name="connection.password">xwiki</property>
<property name="connection.driver_class">org.mariadb.jdbc.Driver</property>
<property name="connection.useUnicode">true</property>
<property name="connection.characterEncoding">UTF-8</property>