Wiki source code of Configure MariaDB

Last modified by Eleni Cojocariu on 2026/11/25 14:48

Show last authors
1 XWiki treats [[MariaDB>>https://mariadb.org/]] exactly as it treats MySQL: the same store, the same database and user, and the same [[storage-engine and character-set requirements>>doc:documentation.xs.admin.installation.database.configure-mysql.storage-engine-character-set.WebHome]]. Only the client command, the JDBC driver and two connection properties differ.
2
3 1. Follow [[Configure MySQL>>doc:documentation.xs.admin.installation.database.configure-mysql.WebHome]] from beginning to end, installing MariaDB instead of MySQL — see the [[Database support strategy>>dev:Community.SupportStrategy.DatabaseSupportStrategy]] for the supported versions — with the three substitutions below.
4 1. 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.
5 1. Copy the MariaDB JDBC driver into ##WEB-INF/lib##, in place of the MySQL one.(((
6 Get [[MariaDB Connector/J>>https://mariadb.com/kb/en/about-mariadb-connector-j/]] from MariaDB or from [[Maven Central>>https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/]]. The JAR file is named ##mariadb-java-client-*.jar##, from the {{code language="none"}}org.mariadb.jdbc:mariadb-java-client{{/code}} artifact.
7 )))
8 1. 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:(((
9 {{code language="xml"}}
10 <property name="hibernate.connection.url">jdbc:mariadb://localhost/xwiki?useSSL=false</property>
11 <property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</property>
12 {{/code}}
13 )))
14 1. 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.

Get Connected