Install and Configure a Relational Database
Steps
To install and configure a relational database for XWiki:
- Install a supported relational database management system.
- Create an XWiki database.
- Create a user with all privileges on that database.
- Copy the JDBC driver for your database into the XWiki web application's WEB-INF/lib directory.
- Configure XWiki to use the database by editing the WEB-INF/hibernate.cfg.xml file, as described in the documentation for each database.
- Start XWiki. It creates the tables it needs on its first run.
- Add the missing indexes manually.
Follow the database-specific documentation for the officially supported databases:
- Configure HSQLDB, which runs embedded and is meant for evaluation rather than production.
- Configure MariaDB.
- MySQL.
- Configure PostgreSQL Manually, or Configure PostgreSQL for XWiki in Docker.
- Oracle.
Whichever database you use, XWiki can also take its connections from a data source managed by the servlet container instead of opening them itself.
XWiki uses Hibernate for persistence, so it may also work with the databases below. They receive no consistent testing, and issues are fixed only when they are easy to resolve or a patch is provided:
FAQ
Which encoding and collation does XWiki expect?
UTF-8 with a binary collation. On MariaDB and MySQL that means utf8mb4 with the utf8mb4_bin collation.
Why does XWiki need a JDBC driver that the WAR does not ship?
The WAR cannot bundle every database driver, and driver licences differ. Download the driver matching your database version and copy it into WEB-INF/lib.
Does each subwiki get its own database?
It depends on the database. PostgreSQL uses one schema per wiki, while MariaDB and MySQL use one database per wiki, which is why the XWiki user needs privileges to create databases.
More
To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.