Configuring a Database

Configuring a Database

By default for demonstration purposes, Liferay DXP/Portal is configured to use an embedded HSQL database. Beyond demonstration purposes, we recommend using a full-featured, supported RDBMS, such as:

  • MariaDB
  • MySQL
  • Oracle
  • PostgreSQL

The Liferay DXP Compatibility Matrix lists the supported databases and versions.

Configure the database

  1. Create a database that uses UTF-8. Here is a MySQL command example:

    create database lportal character set utf8;
  2. Set up a database user with full database permissions. If your organization requires the DXP database user to have limited database access, see High Security Database User Practices.


    Liferay requires reading from and writing to the database. The Liferay database user must therefore have permissions to read and write data.

  3. Install a JDBC Connector. The DXP bundle includes several open source JDBC connectors in the $CATALINA_BASE/webapps/ROOT/WEB-INF/shielded-container-lib folder (in the $CATALINA_BASE/lib/ext folder for previous versions of Liferay). Connectors for proprietary database, like Oracle or DB2 (see the table below), must be downloaded from the vendor.

Proprietary Databases:

Database Connector Vendor Site Notes
Oracle ojdbc8.jar Oracle The ojdbc8.jar library with at least Oracle JDBC 4.2 versioning is required because of data truncation issues that have been detected reading data from CLOB columns.
DB2 db2jcc4.jar IBM The dbc2jcc connector has been deprecated after 3.72.

Congratulations! You configured a database for Liferay DXP.


For database configuration details, see the Database Configuration Reference.

Next Steps