Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Installation 4-database-connection

795 views

Published on

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

Installation 4-database-connection

  1. 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. 2. Objectives <ul><li>Liferay Portal Development </li></ul><ul><li>Set up MySQL </li></ul><ul><li>Create the Database </li></ul><ul><li>Populate the Database </li></ul><ul><li>Configure Tomcat to use the MySQL Database </li></ul>
  3. 3. Install MySQL <ul><li>Double click mysql-5.0.24-win32.exe </li></ul><ul><li>Install MySQL using the default settings </li></ul><ul><li>At the MySQL.com Sign-up screen, select Skip Sign-up </li></ul>
  4. 4. Install MySQL
  5. 5. Install MySQL <ul><li>Click Finish to run the MySQL Server Instance Configuration Wizard </li></ul><ul><li>Select Standard Configuration </li></ul>
  6. 6. Install MySQL <ul><li>Select Include Bin Directory in Windows PATH </li></ul>
  7. 7. <ul><li>Enter asdf for the password </li></ul><ul><li>Retype asdf to confirm the password </li></ul><ul><li>Select Create an anonymous account </li></ul><ul><li>On the next screen, click Execute </li></ul>
  8. 8. Connection Error <ul><li>If the Connection Error window pops up, click Skip . This occurs because the data directory was not removed. </li></ul><ul><li>If you see this screen, you will need to run the Configuration Wizard again. </li></ul>
  9. 9. <ul><li>Create a database called “training” </li></ul><ul><li>Click Start  Run… </li></ul><ul><li>Type cmd and press Enter </li></ul><ul><li>Type mysql </li></ul><ul><li>Type create database training; </li></ul>
  10. 10. <ul><li>Populate your database </li></ul><ul><li>Click Start  Run… </li></ul><ul><li>Type cmd and press Enter </li></ul><ul><li>Navigate to the C:Trainingliferayextsqlportal directory </li></ul><ul><li>Type mysql training < portal-mysql.sql </li></ul>
  11. 11. <ul><li>Configure Tomcat to use MySQL </li></ul><ul><li>Go to C:TrainingliferaytomcatconfCatalinalocalhost </li></ul><ul><li>Open ROOT.xml with Notepad </li></ul>
  12. 12. <ul><li>Change the driverClassName from org.hsqldb.jdbcDriver to com.mysql.jdbc.Driver driverClassName=“com.mysql.jdbc.Driver” </li></ul><ul><li>Change the url from jdbc:mysql:test to url=“jdbc:mysql://localhost/training?useUnicode=true&amp;characterEncoding=UTF-8” </li></ul><ul><li>Change the username to root username=“root” </li></ul><ul><li>Change the password to asdf password=“asdf” </li></ul>Configure Tomcat to use MySQL
  13. 13. Deploy the MySQL Driver <ul><li>Copy mysql.jar from C:Trainingliferay extlib development to C:Trainingliferay extext-lib global </li></ul><ul><li>Click Start  Run… </li></ul><ul><li>Type cmd and press Enter </li></ul><ul><li>Navigate to the C:trainingliferayext </li></ul><ul><li>Type ant deploy </li></ul><ul><li>Verify that mysql.jar was deployed to C:Trainingliferaytomcatcommonlibext </li></ul>
  14. 14. Congratulations! <ul><li>You’ve just set up the database connection! </li></ul><ul><li>Set up MySQL </li></ul><ul><li>Created a database called training </li></ul><ul><li>Populated the database with the portal-mysql.sql script </li></ul><ul><li>Configured ROOT.xml to use the MySQL database instead of the Hypersonic database </li></ul>
  15. 15. Revision History <ul><li>Edward Shin 8/28/2006 Updated for Liferay 4.1.1 </li></ul><ul><li>Mark Wong 9/12/2006 Updated MySQL version </li></ul>

×