Legacy Knowledge Base
Published Sep. 10, 2025

Setting Up and Configuring MySQL Database With Liferay Portal

Written By

Liferay Support

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

This article will help users by providing instructions for setting up MySQL on your machine, creating a new database, and then connecting Liferay Portal to that database.

Resolution

Installing MySQL

  1. Double click the MySQL version that you have obtained, either workbench or 5.1+ are acceptable.
  2. Select Typical and then hit next
  3. Select Install
  4. Click through the prompts, finally clicking next with the Launch the MySQL Instance Configuration Wizard checkbox selected.
  5. Select Detailed Configuration
  6. Select Developer Machine
  7. Select Multifunctional Database
  8. Select the correct drive that it should be installed on
  9. Select Decision Support
  10. Keep the TCP/IP Networking options at default.
  11. Select the option to have UTF8 as the default character select.

Finish installation, selecting a password and keeping the other options as default or modifying them as needed. Two helpful options are:

  1. Include Bin Directory in Windows PATH
  2. Enable root access from remote machines.

Create a database on MySQL

  1. Go to the start menu -> all programs -> MySQL -> MySQL Command line
  2. Type in the password that you initially established
  3. Type in "create database 'DB_NAME';"

*Notice the semi-colon at the end of the command. One feature of the MySQL command line that's helpful is that if you forget the semi colon, you can simply type it in the next line and hit enter. The command will execute like normal.

Preparing Tomcat

  1. Use the program of your choice to unzip the Tomcat Bundle to a convenient location.
  2. For 6.1.x and later: Download the appropriate connector at http://dev.mysql.com/downloads/connector/j/
  3. Unzip and add the connector jar to TOMCAT_HOME/lib/ext

Connecting MySQL database to the Tomcat Bundle

  1. Create a new text document labeled portal-ext.properties
  2. Place the portal-ext.properties within the Liferay Home folder.
  3. Place this text within the portal-ext.properties:

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

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

    3. jdbc.default.username=root

    4. jdbc.default.password=password

  4. Modify the following to your own settings.
    1. Replace localhost in the above propertyjdbc.default.url with the IP address of where you set up the MySQL database (unless your database is on your local machine in which case you can leave it as "localhost")

    2. Replace lportal in the above propertyjdbc.default.url with the name of the database.

    3. Replace password in the above propertyjdbc.default.password with the initial password that is used to connect to MySQL.

Running Tomcat

Go to the folder path: [LIFERAY_BUNDLE][TOMCAT_FOLDER]\bin and double-click startup.bat

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base