Wiki source code of MariaDB Installation
Last modified by Thomas Mortagne on 2023/01/02
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Compatibility Considerations = | ||
2 | |||
3 | See [[Database support strategy>>dev:Community.DatabaseSupportStrategy]] for the supported versions. | ||
4 | |||
5 | XWiki expects the database to use ##utf8## or ##utf8mb4## encoding with collation ##*_bin## and it's highly recommended to use ##utf8mb4## (and ##utf8mb4_bin##). | ||
6 | |||
7 | == MariaDB versions older than 10.2 == | ||
8 | |||
9 | 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. | ||
10 | |||
11 | = Installation Steps = | ||
12 | |||
13 | In general you should follow the instructions for [[installing MySQL>>InstallationMySQL]] since MariaDB is supposed to be a drop-in replacement for MySQL. | ||
14 | |||
15 | Here are the differences with the MySQL installation: | ||
16 | |||
17 | * Download and install [[MariaDB>>https://mariadb.org/]], using a [[supported version>>dev:Community.DatabaseSupportStrategy]] | ||
18 | * 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>>https://mariadb.com/kb/en/about-mariadb-connector-j/]] or directly from the [[Maven Central Repository>>https://search.maven.org/artifact/org.mariadb.jdbc/mariadb-java-client]]. | ||
19 | * 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:((( | ||
20 | {{code language="xml"}} | ||
21 | <property name="connection.url">jdbc:mariadb://localhost/xwiki?useSSL=false</property> | ||
22 | <property name="connection.username">xwiki</property> | ||
23 | <property name="connection.password">xwiki</property> | ||
24 | <property name="connection.driver_class">org.mariadb.jdbc.Driver</property> | ||
25 | <property name="connection.useUnicode">true</property> | ||
26 | <property name="connection.characterEncoding">UTF-8</property> | ||
27 | {{/code}} | ||
28 | ))) |