Personal tools
Document Actions

MySQL

Configure GRIA to use MySQL

MySQL

To use a MySQL database called "hibernate" on a server "dbhost" with username "uname" and password "pword" follow the instructions below

  1. Log in to MySQL as the root user: type mysql -u root -p at the shell prompt.
  2. Enter the mysql root user's password when prompted.
  3. Enter the following commands at the MySQL prompt:
    create database hibernate;
    grant all privileges on hibernate to uname@'localhost' identified by 'pword';
    grant all privileges on hibernate to uname@'%' identified by 'pword';
    grant all privileges on hibernate.* to uname@'localhost' identified by 'pword';
    grant all privileges on hibernate.* to uname@'%' identified by 'pword';
    flush privileges;
    

To use this database you need to edit the hibernate.propeties file located in the service's configuration directory. First you must comment out any lines that refer to HypersonicSQL and uncomment the lines that refer to MySQL.

Now edit the file as shown below (make sure to replace "dbhost" with the actual name of the host where the database is located and "uname" and "pword" with the real username and password).

hibernate.dialect org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://dbhost/hibernate
hibernate.connection.username uname
hibernate.connection.password pword
You must also obtain the JDBC Connector JAR file and place this in your Tomcat /common/lib directory. The recommended download at the time of writing is Connector J/3.1

For further information consult the Hibernate and MySQL documentation.

 

Powered by Plone CMS, the Open Source Content Management System