This document provides instructions for setting up a MySQL database connection for a Liferay portal development environment. The steps include installing MySQL, creating a "training" database, populating it with data from a SQL script, and configuring the Tomcat server to use the MySQL database instead of Hypersonic by modifying the ROOT.xml file. Once completed, the user has set up the MySQL database connection for use in their Liferay portal development.
1 of 15
More Related Content
Installation 4-database-connection
1. Database Connection Copyright ? 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission from Liferay, Inc.
2. Objectives Liferay Portal Development Set up MySQL Create the Database Populate the Database Configure Tomcat to use the MySQL Database
3. Install MySQL Double click mysql-5.0.24-win32.exe Install MySQL using the default settings At the MySQL.com Sign-up screen, select Skip Sign-up
7. Enter asdf for the password Retype asdf to confirm the password Select Create an anonymous account On the next screen, click Execute
8. Connection Error If the Connection Error window pops up, click Skip . This occurs because the data directory was not removed. If you see this screen, you will need to run the Configuration Wizard again.
9. Create a database called ¡°training¡± Click Start ? Run¡ Type cmd and press Enter Type mysql Type create database training;
10. Populate your database Click Start ? Run¡ Type cmd and press Enter Navigate to the C:rainingiferayxtqlortal directory Type mysql training < portal-mysql.sql
11. Configure Tomcat to use MySQL Go to C:rainingiferayomcatonfatalinaocalhost Open ROOT.xml with Notepad
12. Change the driverClassName from org.hsqldb.jdbcDriver to com.mysql.jdbc.Driver driverClassName=¡°com.mysql.jdbc.Driver¡± Change the url from jdbc:mysql:test to url=¡°jdbc:mysql://localhost/training?useUnicode=true&characterEncoding=UTF-8¡± Change the username to root username=¡°root¡± Change the password to asdf password=¡°asdf¡± Configure Tomcat to use MySQL
13. Deploy the MySQL Driver Copy mysql.jar from C:rainingiferayextib evelopment to C:rainingiferayextxt-lib lobal Click Start ? Run¡ Type cmd and press Enter Navigate to the C:rainingiferayxt Type ant deploy Verify that mysql.jar was deployed to C:rainingiferayomcatommonibxt
14. Congratulations! You¡¯ve just set up the database connection! Set up MySQL Created a database called training Populated the database with the portal-mysql.sql script Configured ROOT.xml to use the MySQL database instead of the Hypersonic database
15. Revision History Edward Shin 8/28/2006 Updated for Liferay 4.1.1 Mark Wong 9/12/2006 Updated MySQL version