Configure MariaDB

Last modified by Eleni Cojocariu on 2026/09/10 20:35

Steps

XWiki treats MariaDB exactly as it treats MySQL: the same store, the same database and user, and the same storage-engine and character-set requirements. Only the client command, the JDBC driver and two connection properties differ.

  1. Follow Configure MySQL from beginning to end, installing MariaDB instead of MySQL — see the Database support strategy for the supported versions — with the three substitutions below.
  2. Call the mariadb command-line client wherever that procedure calls mysql. The two are the same program: MariaDB 11.0 dropped the mysql name from its container images, where it had been a symbolic link.
  3. Copy the MariaDB JDBC driver into WEB-INF/lib, in place of the MySQL one.

    Get MariaDB Connector/J from MariaDB or from Maven Central. The JAR file is named mariadb-java-client-*.jar, from the org.mariadb.jdbc:mariadb-java-client artifact.

  4. Uncomment the MariaDB configuration block of WEB-INF/hibernate.cfg.xml, rather than the MySQL one, and comment out the other database configurations. It is the same block, with two different values:
        <property name="hibernate.connection.url">jdbc:mariadb://localhost/xwiki?useSSL=false</property>
        <property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</property>
  5. Open your wiki in a browser. XWiki connects to MariaDB, creates its tables on the first start, and serves the wiki without a database error.

FAQ

Can I use a different database name or user?

Yes. Replace xwiki in the creation statements and in the hibernate.connection.url property; the create-database step of the MySQL procedure also has you set the xwiki.db property when the main wiki's database is not called xwiki.

How do I remove the database if needed?

Log in as root and run:

DROP DATABASE xwiki;
DROP USER 'xwiki'@'localhost';

What database encoding and collation should I use?

utf8mb4 with the utf8mb4_bin collation, on the InnoDB storage engine. Both are requirements rather than recommendations, and they are the same ones XWiki has for MySQL.

Related

Get Connected