Install and Configure a Relational Database
Steps
- Install a supported relational database management system.
- Create a database named xwiki, the name every connection URL in the shipped hibernate.cfg.xml already uses.
- 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.
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.
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, select an highlighted topic, or use the table below and filter the columns to narrow your choices.
- Configure HSQLDB
- Run XWiki on the HSQLDB database embedded in its own JVM, with the driver and the hibernate.cfg.xml block it ships with.
- Configure MySQL
- Create an InnoDB database with the utf8mb4 character set and binary collation, add the JDBC driver and point hibernate.cfg.xml at it.
- Configure MariaDB
- Follow the MySQL setup with three changes: the mariadb client, the MariaDB JDBC driver and two connection properties.
- Configure PostgreSQL Manually
- Install PostgreSQL, create the xwiki user and database, add the JDBC driver and point hibernate.cfg.xml at it.
- Configure Oracle Manually
- Install Oracle, create the xwiki user and its tablespace, add the JDBC driver and point hibernate.cfg.xml at the database.