Database Configuration

Database Configuration

If you don’t configure Liferay to any database then by default Liferay will use HSQLDB (Hyper SQL Database) as its internal database. However this database is not advice able to use for liferay development as well as production environment. You must have to configure your liferay with your convenient database.

Below are the popular databases that can be configured with Liferay Portal

  • DB2
  • DerbyDBHypersonic
  • IngresDB
  • MySQL
  • Oracle
  • P6Spy
  • PostgreSQL
  • SQL Server
  • Sybase

The most popular database for development purpose is MySQL database as its free and easy to use.

How to configure MySQL and Liferay

The configuration is generally done in properties file. The name of the properties file is portal-ext.properties. It should be inside your application server such as tomcat, jboss etc.

In case of Liferay Tomcat Bundle the location of the properties file would be in

\tomcat-7.0.27\webapps\ROOT\WEB-INF\classes. If the properties file is not available you can manually create the properties file. Add the below contents in the properties file

jdbc.default.driverClassName=com.mysql.jdbc.Driver

jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false

jdbc.default.username=test
jdbc.default.password=pass

In the above case mysql user name is test and password is pass. You have to provide proper mysql credentials according to your mysql setup. And lportal is the database that we are connecting .

Thats all about MySql configuration with Liferay. Now you have to restart your liferay tomcat bundle to connect to MySQL.

Scroll to Top
%d