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
- Double click the MySQL version that you have obtained, either workbench or 5.1+ are acceptable.
- Select Typical and then hit next
- Select Install
- Click through the prompts, finally clicking next with the Launch the MySQL Instance Configuration Wizard checkbox selected.
- Select Detailed Configuration
- Select Developer Machine
- Select Multifunctional Database
- Select the correct drive that it should be installed on
- Select Decision Support
- Keep the TCP/IP Networking options at default.
- 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:
- Include Bin Directory in Windows PATH
- Enable root access from remote machines.
Create a database on MySQL
- Go to the start menu -> all programs -> MySQL -> MySQL Command line
- Type in the password that you initially established
- 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
- Use the program of your choice to unzip the Tomcat Bundle to a convenient location.
- For 6.1.x and later: Download the appropriate connector at http://dev.mysql.com/downloads/connector/j/
- Unzip and add the connector jar to TOMCAT_HOME/lib/ext
Connecting MySQL database to the Tomcat Bundle
- Create a new text document labeled
portal-ext.properties
- Place the portal-ext.properties within the Liferay Home folder.
-
Place this text within the
portal-ext.properties
:-
jdbc.default.driverClassName=com.mysql.jdbc.Driver
-
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
-
jdbc.default.username=root
-
jdbc.default.password=password
-
- Modify the following to your own settings.
-
Replace
localhost
in the abovepropertyjdbc.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") -
Replace
lportal
in the abovepropertyjdbc.default.url
with the name of the database. -
Replace
password
in the abovepropertyjdbc.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