Database Administration

Last modified by Vincent Massol on 2020/04/05

XWiki uses by default a database to store its data. You will find on this page tips and tricks to administer and tune your database setup. For Installation please check the Installation guide which contains information on how to setup XWiki for multiple databases.

Indexes

Even though we've configured XWiki to let Hibernate create indexes by default, there can be some limitations on some databases. For example on MySQL, indexes cannot be created automatically for string columns longer than 255 chars (MySQL has a limit of 255 characters - See also InnoDB limits).

Instructions depending on the database you use:

Sanity Checks

To verify the consistency of your XWiki database you can run the sanity check script. The script will select rows that are inconsistent with the logics of XWiki. If no rows are selected, it means the script itself can not detect any error.

  • If you use MySQL as your database:
    • The following sanity check script has been tested for MySQL 5.0 (also been reported to work with MS-SQL)
    • Another script is a variant of the previous script for MySQL 4.x replacing some syntax with more ancient one (still reports errors in one command)
  • If you use postgresql as your database:
    • Here is a modified version of the sanity check script, to be run in the "query" tool of pgAdmin. It is the same as the script for MySQL, except that the syntax for SQL comments is different.
    • pgAdmin is the GUI tool provided with postgresql to access the database. Run pgAdmin, select the xwiki database, and choose the "Query" option in the "Tools" menu. Then just open the script and click on the play icon ("Execute query").

Database browsing

DbVisualizer

DbVisualizer natively supports these DBs:

  • DB2 for Windows/Linux
  • JavaDB/Derby
  • MySQL
  • PostgreSQL
  • and more

Any DB using the corresponding JDBC driver:

  • Example: HSQLDB by using the driver bundled with XWiki
Tags:
Created by Vincent Massol on 2017/09/06
   

Get Connected