ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
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.
Objectives Liferay Portal Development Set up MySQL Create the Database Populate the Database Configure Tomcat to use the MySQL Database
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
Install MySQL
Install MySQL Click Finish to run the MySQL Server Instance Configuration Wizard Select  Standard Configuration
Install MySQL Select  Include Bin Directory in Windows PATH
Enter  asdf  for the password Retype  asdf  to confirm the password Select  Create an anonymous account On the next screen, click Execute
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.
Create a database called ¡°training¡± Click Start  ?  Run¡­ Type  cmd  and press Enter Type  mysql Type  create database training;
Populate your database Click Start  ?  Run¡­ Type  cmd  and press Enter Navigate to the  C:rainingiferayxtqlortal  directory Type  mysql training < portal-mysql.sql
Configure Tomcat to use MySQL Go to  C:rainingiferayomcatonfatalinaocalhost Open  ROOT.xml  with Notepad
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&amp;characterEncoding=UTF-8¡± Change the username to root username=¡°root¡± Change the password to asdf password=¡°asdf¡± Configure Tomcat to use MySQL
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
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
Revision History Edward Shin 8/28/2006 Updated for Liferay 4.1.1 Mark Wong 9/12/2006  Updated MySQL version

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
  • 5. Install MySQL Click Finish to run the MySQL Server Instance Configuration Wizard Select Standard Configuration
  • 6. Install MySQL Select Include Bin Directory in Windows PATH
  • 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&amp;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