By default, Liferay uses the HSQL database. This default database configuration can be switched to another database like MySQL. This post will give a step by step approach to set up Liferay with MySQL database.

  • Download the Liferay tomcat bundle and setup the Liferay development environment. Please refer to the link for more information.
  • Install MySQL service on windows. Please refer to the link for more information.
  • Open MySQL DB from the command prompt and create a database called “lportal” as shown:
LiferayMysql1
  • Navigate to the path:  ${CATALINA_HOME}/webapps/ROOT/WEB-INF/classes
  • Create a new property file named “portal-ext.properties” and add the DB configuration settings as follows:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username={db username}
jdbc.default.password={db password}
  • Save the file and restart the tomcat server.
  • The Liferay portal is now ready to use.

Note: For the first time server takes several minutes to create default tables inside newly created lportal DB.

You may also interested in